1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:50:04 +08:00

Improve incsearch config

This commit is contained in:
wsdjeg 2017-02-23 00:25:04 +08:00
parent 91094ce8b2
commit dc438eee1e
3 changed files with 36 additions and 3 deletions

View File

@ -6,7 +6,7 @@ function! SpaceVim#layers#edit#plugins() abort
\ ['scrooloose/nerdcommenter'],
\ ['mattn/emmet-vim', { 'on_cmd' : 'EmmetInstall'}],
\ ['gcmt/wildfire.vim',{'on_map' : '<Plug>(wildfire-'}],
\ ['easymotion/vim-easymotion',{'on_map' : '<Plug>(easymotion-prefix)'}],
\ ['easymotion/vim-easymotion',{'on_map' : '<Plug>(easymotion-prefix)', 'on_func' : 'EasyMotion#go'}],
\ ['editorconfig/editorconfig-vim', { 'on_cmd' : 'EditorConfigReload'}],
\ ['floobits/floobits-neovim', { 'on_cmd' : ['FlooJoinWorkspace','FlooShareDirPublic','FlooShareDirPrivate']}],
\ ]

View File

@ -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 / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
set hlsearch
let g:incsearch#auto_nohlsearch = 1
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#)
function! s:config_fuzzyall(...) abort
return extend(copy({
\ 'converters': [
\ incsearch#config#fuzzy#converter(),
\ incsearch#config#fuzzyspell#converter()
\ ],
\ }), get(a:, 1, {}))
endfunction
noremap <silent><expr> z/ incsearch#go(<SID>config_fuzzyall())
noremap <silent><expr> z? incsearch#go(<SID>config_fuzzyall({'command': '?'}))
noremap <silent><expr> zg? incsearch#go(<SID>config_fuzzyall({'is_stay': 1}))
function! s:config_easyfuzzymotion(...) abort
return extend(copy({
\ 'converters': [incsearch#config#fuzzy#converter()],
\ 'modules': [incsearch#config#easymotion#module()],
\ 'keymap': {"\<CR>": '<Over>(easymotion)'},
\ 'is_expr': 0,
\ 'is_stay': 1
\ }), get(a:, 1, {}))
endfunction
noremap <silent><expr> <Space>/ incsearch#go(<SID>config_easyfuzzymotion())
endfunction

View File

@ -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' : '<Plug>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']}],