diff --git a/autoload/EasyMotion.vim b/autoload/EasyMotion.vim index c9697b1..b3675e7 100644 --- a/autoload/EasyMotion.vim +++ b/autoload/EasyMotion.vim @@ -313,9 +313,10 @@ function! EasyMotion#SelectPhraseDelete() "{{{ endif endfunction "}}} " -- User Motion ------------------------- -function! EasyMotion#User(pattern, visualmode, direction) " {{{ +function! EasyMotion#User(pattern, mode, direction) " {{{ + let visualmode = match('\v([Vv])|(C-v)', a:mode) > 0 ? visualmode() : '' let re = escape(a:pattern, '|') - call s:EasyMotion(re, a:direction, a:visualmode ? visualmode() : '', mode(1)) + call s:EasyMotion(re, a:direction, visualmode, a:mode) endfunction " }}} function! EasyMotion#UserMapping(re, mapping, direction) " {{{ silent exec "nnoremap ".a:mapping." :call EasyMotion#User('".a:re."', 0, ".a:direction.")" diff --git a/plugin/EasyMotion.vim b/plugin/EasyMotion.vim index 1e8916d..47290a5 100644 --- a/plugin/EasyMotion.vim +++ b/plugin/EasyMotion.vim @@ -101,36 +101,25 @@ augroup end " -- Find Motion {{{ " F: {{{ -noremap (easymotion-s) - \ ':call EasyMotion#S(1, "' . EasyMotion#helper#mode(1) . '" ,2)' -xnoremap (easymotion-s) - \ ':call EasyMotion#S(1, "' . EasyMotion#helper#mode(1) . '" ,2)' -noremap (easymotion-f) - \ ':call EasyMotion#S(1, "' . EasyMotion#helper#mode(1) . '" ,0)' -xnoremap (easymotion-f) - \ ':call EasyMotion#S(1, "' . EasyMotion#helper#mode(1) . '" ,0)' -noremap (easymotion-F) - \ ':call EasyMotion#S(1, "' . EasyMotion#helper#mode(1) . '" ,1)' -xnoremap (easymotion-F) - \ ':call EasyMotion#S(1, "' . EasyMotion#helper#mode(1) . '" ,1)' +" (cound, visual, direction) +noremap (easymotion-f) :call EasyMotion#S(1,0,0) +xnoremap (easymotion-f) :call EasyMotion#S(1,1,0) +noremap (easymotion-F) :call EasyMotion#S(1,0,1) +xnoremap (easymotion-F) :call EasyMotion#S(1,1,1) +noremap (easymotion-s) :call EasyMotion#S(1,0,2) +xnoremap (easymotion-s) :call EasyMotion#S(1,1,2) "}}} " T: {{{ -noremap (easymotion-t) - \ ':call EasyMotion#T(1, "' . EasyMotion#helper#mode(1) . '" ,0)' -xnoremap (easymotion-t) - \ ':call EasyMotion#T(1, "' . EasyMotion#helper#mode(1) . '" ,0)' -noremap (easymotion-T) - \ ':call EasyMotion#T(1, "' . EasyMotion#helper#mode(1) . '" ,1)' -xnoremap (easymotion-T) - \ ':call EasyMotion#T(1, "' . EasyMotion#helper#mode(1) . '" ,1)' +noremap (easymotion-t) :call EasyMotion#T(1,0,0) +xnoremap (easymotion-t) :call EasyMotion#T(1,1,0) +noremap (easymotion-T) :call EasyMotion#T(1,0,1) +xnoremap (easymotion-T) :call EasyMotion#T(1,1,1) "}}} " Multi: {{{ -noremap (easymotion-s2) - \ ':call EasyMotion#S(2, "' . EasyMotion#helper#mode(1) . '" ,2)' -xnoremap (easymotion-s) - \ ':call EasyMotion#S(2, "' . EasyMotion#helper#mode(1) . '" ,2)' +noremap (easymotion-s2) :call EasyMotion#S(2,0,2) +xnoremap (easymotion-s2) :call EasyMotion#S(2,1,2) "}}} "}}} @@ -213,7 +202,6 @@ xnoremap (easymotion-repeat) " -- Line Motion {{{ " F Line: {{{ -" (cound, visual, direction) noremap (easymotion-fl) :call EasyMotion#SL(1,0,0) xnoremap (easymotion-fl) :call EasyMotion#SL(1,1,0) noremap (easymotion-Fl) :call EasyMotion#SL(1,0,1) @@ -223,7 +211,6 @@ xnoremap (easymotion-sl) :call EasyMotion#SL(1,1,2) "}}} " T Line: {{{ -" (cound, visual, direction) noremap (easymotion-tl) :call EasyMotion#TL(1,0,0) xnoremap (easymotion-tl) :call EasyMotion#TL(1,1,0) noremap (easymotion-Tl) :call EasyMotion#TL(1,0,1)