mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-12-26 05:04:34 +00:00
Add and reorder nvim mappings
This commit is contained in:
parent
b2d1153f47
commit
6bb055d42f
|
@ -4,13 +4,46 @@ nnoremap <Left> <nop>
|
||||||
nnoremap <Right> <nop>
|
nnoremap <Right> <nop>
|
||||||
nnoremap <Up> <nop>
|
nnoremap <Up> <nop>
|
||||||
|
|
||||||
" Stop search highlight with Esc in normal mode (until next search)
|
" Tab navigation
|
||||||
nnoremap <silent> <esc> :noh<CR>
|
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>
|
||||||
|
|
||||||
|
" Splits navigation to just ALT + hjkl
|
||||||
|
nnoremap <A-h> <C-w>h
|
||||||
|
nnoremap <A-j> <C-w>j
|
||||||
|
nnoremap <A-k> <C-w>k
|
||||||
|
nnoremap <A-l> <C-w>l
|
||||||
|
|
||||||
|
" Make adjusting split sizes a bit more friendly
|
||||||
|
noremap <silent> <C-Right> :vertical resize +3<CR>
|
||||||
|
noremap <silent> <C-left> :vertical resize -3<CR>
|
||||||
|
noremap <silent> <C-Up> :resize +3<CR>
|
||||||
|
noremap <silent> <C-Down> :resize -3<CR>
|
||||||
|
|
||||||
" System clipboard interactions
|
" System clipboard interactions
|
||||||
map <C-c> "+y
|
map <C-c> "+y
|
||||||
vnoremap <C-v> "+p
|
vnoremap <C-v> "+p
|
||||||
|
|
||||||
|
" Use more common Undo/Redo shortcuts
|
||||||
|
nnoremap <C-z> :undo<CR>
|
||||||
|
nnoremap <C-y> :redo<CR>
|
||||||
|
|
||||||
|
" Use more common save shortcut
|
||||||
|
nnoremap <C-s> :w<CR>
|
||||||
|
|
||||||
|
" Terminal
|
||||||
|
nnoremap <C-l> :vnew term://zsh<CR>i
|
||||||
|
nnoremap <C-t> :split term://zsh<CR>i
|
||||||
|
nnoremap <A-S-t> :tabnew term://zsh<CR>i
|
||||||
|
|
||||||
|
" Alias replace all
|
||||||
|
nnoremap <A-s> :%s//gI<Left><Left><Left>
|
||||||
|
|
||||||
" Start spell-check
|
" Start spell-check
|
||||||
map <leader>s :setlocal spell! spelllang=en_us<CR>
|
map <leader>s :setlocal spell! spelllang=en_us<CR>
|
||||||
|
|
||||||
|
@ -22,37 +55,16 @@ vnoremap <space> zf
|
||||||
noremap <silent> K 10k
|
noremap <silent> K 10k
|
||||||
noremap <silent> J 10j
|
noremap <silent> J 10j
|
||||||
|
|
||||||
|
" Save file as sudo when no write permissions
|
||||||
|
cmap w!! w !sudo tee > /dev/null %
|
||||||
|
|
||||||
|
" Stop search highlight with Esc in normal mode (until next search)
|
||||||
|
nnoremap <silent> <esc> :noh<CR>
|
||||||
|
|
||||||
" Enable/Disable auto comment
|
" Enable/Disable auto comment
|
||||||
map <leader>c :setlocal formatoptions-=cro<CR>
|
map <leader>c :setlocal formatoptions-=cro<CR>
|
||||||
map <leader>C :setlocal formatoptions=cro<CR>
|
map <leader>C :setlocal formatoptions=cro<CR>
|
||||||
|
|
||||||
" 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>
|
|
||||||
|
|
||||||
" Remap splits navigation to just CTRL + hjkl
|
|
||||||
nnoremap <C-h> <C-w>h
|
|
||||||
nnoremap <C-j> <C-w>j
|
|
||||||
nnoremap <C-k> <C-w>k
|
|
||||||
nnoremap <C-l> <C-w>l
|
|
||||||
|
|
||||||
" Make adjusting split sizes a bit more friendly
|
|
||||||
noremap <silent> <C-Right> :vertical resize +3<CR>
|
|
||||||
noremap <silent> <C-left> :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
|
" Don't leave visual mode after indenting
|
||||||
vmap < <gv
|
vmap < <gv
|
||||||
vmap > >gv
|
vmap > >gv
|
||||||
|
|
Loading…
Reference in a new issue