Closed rgrinberg closed 9 years ago
It already handle to open a fold after search execution.
You mean <Over>(incsearch-next)
(default <Tab>
)? Please give me a more detail information.
No I mean the default n
mapping. Mine is mapped correctly to <Plug>(incsearch-nohl-n)
but it doesn't seem to open folds. The only exception is the first search once I hit <CR>
which does open folds.
:h 'foldopen'
NOTE: When the command is part of a mapping this option is not used. Add the |zv| command to the mapping to get the same effect. (rationale: the mapping may want to control opening folds itself)
Oh, I got it. Please see :h 'foldopen'
.
It's compatible with default n
behavior.
I handled to open fold only for /
& ?
enhancement mappings unlike default one because you cannot add a zv
mapping to them.
That's strange because my foldopen
seems correct as it includes search.
Please read this part.
NOTE: When the command is part of a mapping this option is not used. Add the |zv| command to the mapping to get the same effect. (rationale: the mapping may want to control opening folds itself)
OK thanks I get it.
So what should I remap my config to get the zv
to open on default search ?
partial config
Plug 'haya14busa/incsearch.vim' " Improved incremental searching for Vim
Plug 'haya14busa/incsearch-fuzzy.vim'
Plug 'haya14busa/incsearch-easymotion.vim'
Plug 'Lokaltog/vim-easymotion' " Easy motion
set hlsearch
let g:incsearch#auto_nohlsearch = 1
let g:EasyMotion_smartcase = 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_easyfuzzymotion(...) abort
return extend(copy({
\ 'converters': [incsearch#config#fuzzy#converter()],
\ 'modules': [incsearch#config#easymotion#module()],
\ 'is_expr': 0,
\ 'is_stay': 1,
\ 'smart_case': 1
\ }), get(a:, 1, {}))
endfunction
noremap <silent><expr> / incsearch#go(<SID>config_easyfuzzymotion())
noremap <silent><expr> ? incsearch#go(<SID>config_easyfuzzymotion({'command': '?'}))
map n <Plug>(incsearch-nohl-n)zv
map N <Plug>(incsearch-nohl-N)zv
If the next matching result is inside a fold the fold should be opened.