From dc438eee1e4d721ed141d9d816cc6915be8b0f39 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Thu, 23 Feb 2017 00:25:04 +0800 Subject: [PATCH] Improve incsearch config --- autoload/SpaceVim/layers/edit.vim | 2 +- autoload/SpaceVim/layers/incsearch.vim | 36 +++++++++++++++++++++++++- autoload/SpaceVim/layers/tools.vim | 1 - 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/autoload/SpaceVim/layers/edit.vim b/autoload/SpaceVim/layers/edit.vim index 2c6259914..6ebd4c5a9 100644 --- a/autoload/SpaceVim/layers/edit.vim +++ b/autoload/SpaceVim/layers/edit.vim @@ -6,7 +6,7 @@ function! SpaceVim#layers#edit#plugins() abort \ ['scrooloose/nerdcommenter'], \ ['mattn/emmet-vim', { 'on_cmd' : 'EmmetInstall'}], \ ['gcmt/wildfire.vim',{'on_map' : '(wildfire-'}], - \ ['easymotion/vim-easymotion',{'on_map' : '(easymotion-prefix)'}], + \ ['easymotion/vim-easymotion',{'on_map' : '(easymotion-prefix)', 'on_func' : 'EasyMotion#go'}], \ ['editorconfig/editorconfig-vim', { 'on_cmd' : 'EditorConfigReload'}], \ ['floobits/floobits-neovim', { 'on_cmd' : ['FlooJoinWorkspace','FlooShareDirPublic','FlooShareDirPrivate']}], \ ] diff --git a/autoload/SpaceVim/layers/incsearch.vim b/autoload/SpaceVim/layers/incsearch.vim index 203875734..3691f200c 100644 --- a/autoload/SpaceVim/layers/incsearch.vim +++ b/autoload/SpaceVim/layers/incsearch.vim @@ -3,9 +3,43 @@ function! SpaceVim#layers#incsearch#plugins() abort call add(plugins, ['haya14busa/incsearch.vim', {'merged' : 0}]) call add(plugins, ['haya14busa/incsearch-fuzzy.vim', {'merged' : 0}]) call add(plugins, ['haya14busa/vim-asterisk', {'merged' : 0}]) + call add(plugins, ['haya14busa/incsearch-easymotion.vim', {'merged' : 0}]) return plugins endfunction function! SpaceVim#layers#incsearch#config() abort - + map / (incsearch-forward) + map ? (incsearch-backward) + map g/ (incsearch-stay) + set hlsearch + let g:incsearch#auto_nohlsearch = 1 + map n (incsearch-nohl-n) + map N (incsearch-nohl-N) + map * (incsearch-nohl-*) + map # (incsearch-nohl-#) + map g* (incsearch-nohl-g*) + map g# (incsearch-nohl-g#) + function! s:config_fuzzyall(...) abort + return extend(copy({ + \ 'converters': [ + \ incsearch#config#fuzzy#converter(), + \ incsearch#config#fuzzyspell#converter() + \ ], + \ }), get(a:, 1, {})) + endfunction + + noremap z/ incsearch#go(config_fuzzyall()) + noremap z? incsearch#go(config_fuzzyall({'command': '?'})) + noremap zg? incsearch#go(config_fuzzyall({'is_stay': 1})) + function! s:config_easyfuzzymotion(...) abort + return extend(copy({ + \ 'converters': [incsearch#config#fuzzy#converter()], + \ 'modules': [incsearch#config#easymotion#module()], + \ 'keymap': {"\": '(easymotion)'}, + \ 'is_expr': 0, + \ 'is_stay': 1 + \ }), get(a:, 1, {})) + endfunction + + noremap / incsearch#go(config_easyfuzzymotion()) endfunction diff --git a/autoload/SpaceVim/layers/tools.vim b/autoload/SpaceVim/layers/tools.vim index 8024bb046..3d4612a88 100644 --- a/autoload/SpaceVim/layers/tools.vim +++ b/autoload/SpaceVim/layers/tools.vim @@ -7,7 +7,6 @@ function! SpaceVim#layers#tools#plugins() abort \ ['junegunn/limelight.vim', { 'on_cmd' : 'Limelight'}], \ ['Yggdroot/LeaderF', {'merged' : 0, 'on_cmd' : 'LeaderF'}], \ ['MattesGroeger/vim-bookmarks', { 'on_map' : 'Bookmark', 'loadconf_before' : 1}], - \ ['google/vim-searchindex'], \ ['simnalamburt/vim-mundo', { 'on_cmd' : 'MundoToggle'}], \ ['mhinz/vim-grepper' , { 'on_cmd' : 'Grepper', 'loadconf' : 1} ], \ ['tpope/vim-projectionist',{'on_cmd':['A','AS','AV','AT','AD','Cd','Lcd','ProjectDo']}],