[~] Refactor

This commit is contained in:
Siarhei Siniak 2024-07-01 08:42:58 +03:00
parent aba9020f34
commit 46b534d447

@ -19,6 +19,7 @@ set backspace=indent,eol,start
set mouse=a set mouse=a
au FileType netrw nmap <buffer> <LeftMouse> <LeftMouse> <CR> au FileType netrw nmap <buffer> <LeftMouse> <LeftMouse> <CR>
au FocusLost * silent! wa
set term=xterm-256color set term=xterm-256color
@ -28,12 +29,34 @@ set hls
colorscheme morning colorscheme morning
hi MatchParen guifg=white guibg=black gui=NONE ctermfg=1 ctermbg=0 hi MatchParen guifg=white guibg=black gui=NONE ctermfg=1 ctermbg=0
function! MakeSession()
let b:sessiondir = '.vim/'
if (filewritable(b:sessiondir) != 2)
exe 'silent !mkdir -p ' b:sessiondir
redraw!
endif
let b:filename = b:sessiondir . '/session.vim'
exe "mksession! " . b:filename
endfunction
function! LoadSession()
let b:sessiondir = '.vim/'
let b:sessionfile = b:sessiondir . "/session.vim"
if (filereadable(b:sessionfile))
exe 'source ' b:sessionfile
else
echo "No session loaded."
endif
endfunction
map <Leader>w <C-w> map <Leader>w <C-w>
map <Leader>wo :py3 print('fuck')<CR> map <Leader>wo :py3 print('fuck')<CR>
map <Leader>z :wqa<CR> map <Leader>z :wqa<CR>
map <Leader>m :py3 f1()<CR> map <Leader>m :py3 f1()<CR>
map <Leader>r :redraw!<CR> map <Leader>r :redraw!<CR>
map <Leader>s :call MakeSession()<CR>
map <Leader>l :call LoadSession()
map <Leader>cq :cq<CR> map <Leader>cq :cq<CR>
map <Leader>f2 :py3 f2()<CR> map <Leader>f2 :py3 f2()<CR>
map <Leader>f3 :source ~/.vimrc<CR>:echo 'reloaded'<CR> map <Leader>f3 :source ~/.vimrc<CR>:echo 'reloaded'<CR>