mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-12-27 05:34:35 +00:00
Add more vim mappings
This commit is contained in:
parent
9f0061eaf3
commit
41bbfbffb9
|
@ -1,3 +1,38 @@
|
||||||
|
" Unmap arrow keys in normal mode to remove bad habits
|
||||||
|
nnoremap <Down> <nop>
|
||||||
|
nnoremap <Left> <nop>
|
||||||
|
nnoremap <Right> <nop>
|
||||||
|
nnoremap <Up> <nop>
|
||||||
|
|
||||||
|
" Stop search highlight on esc (until next search)
|
||||||
|
map <silent> <esc> :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>
|
||||||
|
|
||||||
|
" Use shift to move 10 lines up/down quickly
|
||||||
|
noremap <silent> K 10k
|
||||||
|
noremap <silent> J 10j
|
||||||
|
|
||||||
|
" Tab navigation
|
||||||
|
nnoremap <Tab> gt
|
||||||
|
nnoremap <S-Tab> gT
|
||||||
|
nnoremap <silent> <A-t> :tabnew<CR>
|
||||||
|
nnoremap <silent> <A-2> :tabmove +<CR>
|
||||||
|
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
|
" Remap splits navigation to just CTRL + hjkl
|
||||||
nnoremap <C-h> <C-w>h
|
nnoremap <C-h> <C-w>h
|
||||||
nnoremap <C-j> <C-w>j
|
nnoremap <C-j> <C-w>j
|
||||||
|
@ -10,23 +45,3 @@ noremap <silent> <C-Right> :vertical resize -3<CR>
|
||||||
noremap <silent> <C-Up> :resize +3<CR>
|
noremap <silent> <C-Up> :resize +3<CR>
|
||||||
noremap <silent> <C-Down> :resize -3<CR>
|
noremap <silent> <C-Down> :resize -3<CR>
|
||||||
|
|
||||||
" Spell-check set to <leader>o, 'o' for 'orthography'
|
|
||||||
map <leader>o :setlocal spell! spelllang=en_US<CR>
|
|
||||||
|
|
||||||
" Stop search highlight (until next search)
|
|
||||||
map <silent> <esc> :noh<CR>
|
|
||||||
|
|
||||||
" System clipboard interactions
|
|
||||||
map <C-c> "+y
|
|
||||||
vnoremap <C-v> "+p
|
|
||||||
|
|
||||||
" Unmap arrow keys in normal mode to remove bad habits
|
|
||||||
nnoremap <Down> <nop>
|
|
||||||
nnoremap <Left> <nop>
|
|
||||||
nnoremap <Right> <nop>
|
|
||||||
nnoremap <Up> <nop>
|
|
||||||
|
|
||||||
" Use shift to move 10 lines up/down quickly
|
|
||||||
noremap <silent> K 10k
|
|
||||||
noremap <silent> J 10j
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue