mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
refactor(vim): Keymap updates for Vim
- Auto-center cursor on more movements - fix: Quickfix traversals - Buffer traversal similar to Neovim - Paste without yanking - Remove all edit mode mappings copied from NvChad - Remove "copy all" mapping
This commit is contained in:
@@ -36,6 +36,10 @@ nnoremap ]s ]szz
|
|||||||
nnoremap n nzzzv
|
nnoremap n nzzzv
|
||||||
nnoremap N Nzzzv
|
nnoremap N Nzzzv
|
||||||
nnoremap G Gzz
|
nnoremap G Gzz
|
||||||
|
nnoremap g* g*zz
|
||||||
|
nnoremap g# g#zz
|
||||||
|
nnoremap * *zzv
|
||||||
|
nnoremap # #zzv
|
||||||
|
|
||||||
" Move visually selected lines around with J & K
|
" Move visually selected lines around with J & K
|
||||||
vnoremap J :m '>+1<CR>gv=gv
|
vnoremap J :m '>+1<CR>gv=gv
|
||||||
@@ -66,10 +70,11 @@ map <C-l> <C-w>l
|
|||||||
" Navigate buffers
|
" Navigate buffers
|
||||||
nnoremap ]b :bnext<CR>
|
nnoremap ]b :bnext<CR>
|
||||||
nnoremap [b :bprevious<CR>
|
nnoremap [b :bprevious<CR>
|
||||||
|
nnoremap <leader>bx :bd<CR>
|
||||||
|
|
||||||
" Navigate Quickfixs
|
" Navigate Quickfix
|
||||||
nnoremap [q cprev
|
nnoremap [q :cprev<CR>zz
|
||||||
nnoremap ]q cnext
|
nnoremap ]q :cnext<CR>zz
|
||||||
|
|
||||||
" Resize window using <ctrl> arrow keys
|
" Resize window using <ctrl> arrow keys
|
||||||
nnoremap <C-Up> :resize +2<CR>
|
nnoremap <C-Up> :resize +2<CR>
|
||||||
@@ -91,13 +96,12 @@ vnoremap <C-q> :wqa<CR>
|
|||||||
nnoremap <C-s> :wa<CR>
|
nnoremap <C-s> :wa<CR>
|
||||||
vnoremap <C-s> :wa<CR>
|
vnoremap <C-s> :wa<CR>
|
||||||
|
|
||||||
" Move cursor in insert mode
|
" Paste over currently selected text without yanking it
|
||||||
inoremap <M-a> <ESC>^i
|
vnoremap p "_dp
|
||||||
inoremap <M-e> <END>
|
vnoremap P "_dP
|
||||||
inoremap <M-h> <Left>
|
|
||||||
inoremap <M-l> <Right>
|
" Copy everything between { & } including brackets
|
||||||
inoremap <M-j> <Down>
|
nnoremap YY va{Vy
|
||||||
inoremap <M-k> <Up>
|
|
||||||
|
|
||||||
" Move Lines with Alt+j,k
|
" Move Lines with Alt+j,k
|
||||||
nnoremap <M-j> :m .+1<cr>==
|
nnoremap <M-j> :m .+1<cr>==
|
||||||
@@ -113,9 +117,6 @@ imap , ,<C-g>u
|
|||||||
imap . .<C-g>u
|
imap . .<C-g>u
|
||||||
imap ; ;<C-g>u
|
imap ; ;<C-g>u
|
||||||
|
|
||||||
" Copy entire content of the current buffer
|
|
||||||
nnoremap <C-c> :%y+<CR>
|
|
||||||
|
|
||||||
" Copy to system clipboard
|
" Copy to system clipboard
|
||||||
nnoremap <leader>y "+y
|
nnoremap <leader>y "+y
|
||||||
vnoremap <leader>y "+y
|
vnoremap <leader>y "+y
|
||||||
|
|||||||
Reference in New Issue
Block a user