This commit is contained in:
2021-10-13 21:09:05 +00:00

19
vimrc
View File

@@ -72,8 +72,15 @@ nnoremap <c-/> gc
" save all and quit
nnoremap <leader>q :wa<cr>ZQ
function! RunBlackIfInPythonFile()
if &filetype ==# 'python'
:call Black()
endif
endfunction
" save
nnoremap <c-s> :w<cr>
nnoremap <c-s> :call RunBlackIfInPythonFile()<cr>:w<cr>
" save and close buffer
nnoremap <leader>w :w<cr>:bw<cr>
nnoremap <c-h> :bp<cr>
@@ -82,7 +89,7 @@ nnoremap <c-l> :bn<cr>
nnoremap <c-e> :noh<cr>
nnoremap <leader>p :PlugInstall<cr>
nnoremap <buffer><silent> <leader>f <cmd>call Black()<cr>
nnoremap <leader>b :call RunBlackIfInPythonFile()<cr>
" show number of lines in buffer
nnoremap <leader>l :echo line("$")<cr>
@@ -90,6 +97,14 @@ nnoremap <leader>l :echo line("$")<cr>
" quickly source vimrc with <space> + s
nnoremap <leader>s :source ~/.vimrc<cr>
" move selection
nnoremap <C-j> :m .+1<CR>==
nnoremap <C-k> :m .-2<CR>==
inoremap <C-j> <ESC>:m .+1<CR>==gi
inoremap <C-k> <ESC>:m .-2<CR>==gi
vnoremap <C-j> :m '>+1<CR>gv=gv
vnoremap <C-k> :m '<-2<CR>gv=gv
let g:python3_host_prog = $HOME . '/.local/venv/nvim/bin/python'
let g:black#settings = {
\ 'fast': 1,