Update vim config

This commit is contained in:
ItsDrike 2021-08-16 03:19:56 +02:00
parent 49b1fb917e
commit 1de5142b86
No known key found for this signature in database
GPG key ID: B5F6B41F708C3ADD
3 changed files with 28 additions and 12 deletions

View file

@ -4,20 +4,24 @@ nnoremap <Left> <nop>
nnoremap <Right> <nop>
nnoremap <Up> <nop>
" Stop search highlight on esc (until next search)
map <silent> <esc> :noh<CR>
" Stop search highlight on Ctrl+l (until next search)
map <silent> <C-l> :noh<CR>
" System clipboard interactions
map <C-c> "+y
vnoremap <C-v> "+p
" Spell-check set to <leader>o, 'o' for 'orthography'
map <leader>o :setlocal spell! spelllang=en_US<CR>
" Start spell-check
map <leader>s :setlocal spell! spelllang=en_us<CR>
" Use shift to move 10 lines up/down quickly
noremap <silent> K 10k
noremap <silent> J 10j
" Enable/Disable auto comment
map <leader>c :setlocal formatoptions-=cro<CR>
map <leader>C :setlocal formatoptions=cro<CR>
" Tab navigation
nnoremap <Tab> gt
nnoremap <S-Tab> gT
@ -27,12 +31,6 @@ nnoremap <silent> <A-1> :tabmove -<CR>
nnoremap <A-p> :tabp<CR>
nnoremap <A-n> :tabn<CR>
" Alias replace all
nnoremap <A-s> :%s//gI<Left><Left><Left>
" Save file as sudo when no write permissions
cmap w!! w !sudo tee > /dev/null %
" Remap splits navigation to just CTRL + hjkl
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
@ -45,7 +43,18 @@ noremap <silent> <C-Right> :vertical resize -3<CR>
noremap <silent> <C-Up> :resize +3<CR>
noremap <silent> <C-Down> :resize -3<CR>
" Alias replace all
nnoremap <A-s> :%s//gI<Left><Left><Left>
" Save file as sudo when no write permissions
cmap w!! w !sudo tee > /dev/null %
" Don't leave visual mode after indenting
vmap < <gv
vmap > >gv
" Compile opened file (using custom comp script)
nnoremap <A-c> :w \| !comp <c-r>%<CR>
" Shell check
nnoremap <leader>p :!shellcheck %<CR>