diff --git a/nvim/init.vim b/nvim/init.vim index e5ea780..982468d 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -7,9 +7,10 @@ Plug 'tpope/vim-endwise' Plug 'jiangmiao/auto-pairs' " Tab completion Plug 'ervandew/supertab' -" EasyMotion - Allows (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 nnoremap :WhichKey '' nnoremap :WhichKey ',' +map c (easymotion-bd-f) +nmap c (easymotion-overwin-f) + +map L (easymotion-bd-jk) +nmap L (easymotion-overwin-line) + +map w (easymotion-bd-w) +nmap w (easymotion-overwin-w) + +noremap / incsearch#go(incsearch_config()) +noremap ? incsearch#go(incsearch_config({'command': '?'})) +noremap g/ incsearch#go(incsearch_config({'is_stay': 1})) + +map l (easymotion-lineforward) +map j (easymotion-j) +map k (easymotion-k) +map h (easymotion-linebackward) + command! -bang -nargs=* GGrep \ call fzf#vim#grep( \ 'git grep --line-number '.shellescape(), 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': { + \ "\": '(easymotion)' + \ }, + \ 'is_expr': 0 + \ }), get(a:, 1, {})) +endfunction