diff --git a/autoload/EasyMotion.vim b/autoload/EasyMotion.vim index 2a472237..f1ea97b9 100644 --- a/autoload/EasyMotion.vim +++ b/autoload/EasyMotion.vim @@ -1196,6 +1196,14 @@ function! s:DotPromptUser(groups) "{{{ endfunction "}}} function! s:EasyMotion(regexp, direction, visualmode, is_inclusive, ...) " {{{ + " Set local iskeyword for EasyMotion + if exists('g:EasyMotion_is_not_keyword') + let s:initial_keyword = &iskeyword + let s:exclude_keyword = split(g:EasyMotion_is_not_keyword, ',') + for item in s:exclude_keyword + execute 'set iskeyword-='.item + endfor + endif let config = extend(s:default_config(), get(a:, 1, {})) " Store s:current original_position & cursor_position {{{ " current cursor pos. @@ -1598,6 +1606,10 @@ function! s:EasyMotion(regexp, direction, visualmode, is_inclusive, ...) " {{{ call EasyMotion#attach_active_autocmd() "}}} endif endtry + " Turn iskeyword back to normal setting + if exists('g:EasyMotion_is_not_keyword') + execute 'set iskeyword='.s:initial_keyword + endif endfunction " }}} "}}} " }}} diff --git a/doc/easymotion.txt b/doc/easymotion.txt index 1998112f..9c65826c 100644 --- a/doc/easymotion.txt +++ b/doc/easymotion.txt @@ -475,6 +475,14 @@ iskeyword compatible word motions *(easymotion-iskeyword-w)* map b (easymotion-iskeyword-b) < NOTE: Within line motions are compatible with |iskeyword| by default. + If you want separated |iskeyword| for EasyMotion, you can use default + |iskeyword| option separated by comma. + + Example: +> + " Exclude - and _ (dash and underscore) + let g:EasyMotion_is_not_keyword = "-,_" +< Search motion respect previous direction