nvim: init.vim: More easymotion settings

With easymotion makes quick-scope is not required.
This commit is contained in:
Sanchayan Maity 2019-12-10 10:52:04 +05:30 committed by Sanchayan Maity
parent d832758501
commit e08b4113f0

View file

@ -7,9 +7,10 @@ Plug 'tpope/vim-endwise'
Plug 'jiangmiao/auto-pairs'
" Tab completion
Plug 'ervandew/supertab'
" EasyMotion - Allows <leader><leader>(b|e) to jump to (b)eginning or (end)
" of words.
" EasyMotion
Plug 'easymotion/vim-easymotion'
Plug 'haya14busa/incsearch.vim'
Plug 'haya14busa/incsearch-easymotion.vim'
" Fuzzy search
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
@ -84,7 +85,6 @@ Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-sleuth'
Plug 'tpope/vim-vinegar'
Plug 'editorconfig/editorconfig-vim'
Plug 'unblevable/quick-scope'
Plug 'igankevich/mesonic'
Plug 'rhysd/vim-clang-format', { 'for': [ 'c', 'cpp'] }
Plug 'stefandtw/quickfix-reflector.vim'
@ -98,7 +98,6 @@ Plug 'mbbill/undotree'
Plug 'milkypostman/vim-togglelist'
Plug 'jpalardy/vim-slime'
Plug 'liuchengxu/vim-which-key'
Plug 'haya14busa/incsearch.vim'
Plug 'jceb/vim-orgmode'
Plug 'wellle/targets.vim'
Plug 'takac/vim-hardtime'
@ -319,6 +318,24 @@ noremap <Right> <NOP>
nnoremap <silent> <Leader> :<C-U>WhichKey '<Space>'<CR>
nnoremap <silent> <LocalLeader> :<C-U>WhichKey ','<CR>
map <Leader><Leader>c <Plug>(easymotion-bd-f)
nmap <Leader><Leader>c <Plug>(easymotion-overwin-f)
map <Leader><Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader><Leader>L <Plug>(easymotion-overwin-line)
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}))
map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)
command! -bang -nargs=* GGrep
\ call fzf#vim#grep(
\ 'git grep --line-number '.shellescape(<q-args>), 0,
@ -653,3 +670,13 @@ function! FloatingFZF()
" open the new window, floating, and enter to it
call nvim_open_win(buf, v:true, opts)
endfunction
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