nvim: init.vim: Add helpers for tabular

This commit is contained in:
Sanchayan Maity 2019-12-24 08:44:27 +05:30 committed by Sanchayan Maity
parent bc587c5991
commit 2ea68f3b4f
1 changed files with 17 additions and 7 deletions

View File

@ -320,30 +320,40 @@ noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
" Whick key
nnoremap <silent> <Leader> :<C-U>WhichKey '<Space>'<CR>
nnoremap <silent> <LocalLeader> :<C-U>WhichKey ','<CR>
" Bindings for easy motion
" Character motions
map <Leader><Leader>c <Plug>(easymotion-bd-f)
nmap <Leader><Leader>c <Plug>(easymotion-overwin-f)
" Line motions
map <Leader><Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader><Leader>L <Plug>(easymotion-overwin-line)
" Word motions
map <Leader><Leader>w <Plug>(easymotion-bd-w)
nmap <Leader><Leader>w <Plug>(easymotion-overwin-w)
noremap <silent><expr> / incsearch#go(<SID>incsearch_config())
noremap <silent><expr> ? incsearch#go(<SID>incsearch_config({'command': '?'}))
noremap <silent><expr> g/ incsearch#go(<SID>incsearch_config({'is_stay': 1}))
" Line motion jump
map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)
" Incremental search + easymotion
noremap <silent><expr> / incsearch#go(<SID>incsearch_config())
noremap <silent><expr> ? incsearch#go(<SID>incsearch_config({'command': '?'}))
noremap <silent><expr> g/ incsearch#go(<SID>incsearch_config({'is_stay': 1}))
" Tag helpers
map <C-\> :vsp <CR>:exec("tag ".expand("<cword>"))<CR>
map <A-]> :sp <CR>:exec("tag ".expand("<cword>"))<CR>
" Tabular helpers
vmap a= :Tabularize /=<CR>
vmap a; :Tabularize /::<CR>
vmap a- :Tabularize /-><CR>
vmap a: :Tabularize /:r1c1l0<CR>
command! -bang -nargs=* GGrep
\ call fzf#vim#grep(
\ 'git grep --line-number '.shellescape(<q-args>), 0,