nvim: Drop easymotion
We use easymotion primarily for vertical motion and any motion requires at least 3 or 4 key bindings which isn't necessarily different if we are using relative numbers. For example, pressing <Leader>j and then pressing another one or two keys for the vertical movement is the same number of keys while using relative numbers. So just use relative numbers and drop it. We also never used the word and character motions or cross window motions. Use f,F,t,T for horizontal line motions. Use clever-f for this, which improves the default behaviour. For any other motion not covered by these two, just use incsearch. While at it, move some of the key bindings to after/plugin to have key bindings specific to a plugin in it's own file. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
parent
fee71ae71e
commit
3c0e1088ad
6 changed files with 17 additions and 46 deletions
4
nvim/.config/nvim/after/plugin/easy-align.vim
Normal file
4
nvim/.config/nvim/after/plugin/easy-align.vim
Normal file
|
@ -0,0 +1,4 @@
|
|||
" Start interactive EasyAlign in visual mode (e.g. vipga)
|
||||
xmap ga <Plug>(EasyAlign)
|
||||
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
|
||||
nmap ga <Plug>(EasyAlign)
|
9
nvim/.config/nvim/after/plugin/incsearch.vim
Normal file
9
nvim/.config/nvim/after/plugin/incsearch.vim
Normal file
|
@ -0,0 +1,9 @@
|
|||
map / <Plug>(incsearch-forward)
|
||||
map ? <Plug>(incsearch-backward)
|
||||
map g/ <Plug>(incsearch-stay)
|
||||
map n <Plug>(incsearch-nohl-n)
|
||||
map N <Plug>(incsearch-nohl-N)
|
||||
map * <Plug>(incsearch-nohl-*)
|
||||
map # <Plug>(incsearch-nohl-#)
|
||||
map g* <Plug>(incsearch-nohl-g*)
|
||||
map g# <Plug>(incsearch-nohl-g#)
|
|
@ -32,6 +32,7 @@ set undofile " Enable undo persistence across sessions
|
|||
set hidden
|
||||
set noautochdir
|
||||
set hlsearch
|
||||
set relativenumber
|
||||
|
||||
" Wild menu
|
||||
set wildmenu
|
||||
|
|
|
@ -2,10 +2,9 @@ call plug#begin('~/.config/nvim/plugged')
|
|||
|
||||
" Tab completion
|
||||
Plug 'ervandew/supertab'
|
||||
" EasyMotion
|
||||
Plug 'easymotion/vim-easymotion'
|
||||
" Motions
|
||||
Plug 'haya14busa/incsearch.vim'
|
||||
Plug 'haya14busa/incsearch-easymotion.vim'
|
||||
Plug 'rhysd/clever-f.vim'
|
||||
" Fuzzy search
|
||||
Plug 'junegunn/fzf.vim'
|
||||
" Remove extraneous whitespace when edit mode is exited
|
||||
|
|
|
@ -161,48 +161,6 @@ noremap <Right> <NOP>
|
|||
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)
|
||||
" 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}))
|
||||
" Incremental search
|
||||
map n <Plug>(incsearch-nohl-n)
|
||||
map N <Plug>(incsearch-nohl-N)
|
||||
map * <Plug>(incsearch-nohl-*)
|
||||
map # <Plug>(incsearch-nohl-#)
|
||||
map g* <Plug>(incsearch-nohl-g*)
|
||||
map g# <Plug>(incsearch-nohl-g#)
|
||||
|
||||
" Tag helpers
|
||||
nnoremap <C-\> :vsp <CR>:exec("tag ".expand("<cword>"))<CR>
|
||||
nnoremap <A-]> :sp <CR>:exec("tag ".expand("<cword>"))<CR>
|
||||
|
||||
" Start interactive EasyAlign in visual mode (e.g. vipga)
|
||||
xmap ga <Plug>(EasyAlign)
|
||||
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
|
||||
nmap ga <Plug>(EasyAlign)
|
||||
|
||||
function! s:incsearch_config(...) abort
|
||||
return incsearch#util#deepextend(deepcopy({
|
||||
\ 'modules': [incsearch#config#easymotion#module({'overwin': 1})],
|
||||
\ 'keymap': {
|
||||
\ "\<CR>": '<Over>(easymotion)'
|
||||
\ },
|
||||
\ 'is_expr': 0
|
||||
\ }), get(a:, 1, {}))
|
||||
endfunction
|
||||
|
|
|
@ -73,7 +73,7 @@ let g:grepper.switch = 0
|
|||
let g:grepper.append = 0
|
||||
let g:grepper.prompt = 0
|
||||
|
||||
" Easymotion incsearch
|
||||
" Incremental search
|
||||
let g:incsearch#auto_nohlsearch = 1
|
||||
|
||||
" Buftabline
|
||||
|
|
Loading…
Reference in a new issue