diff --git a/autoload/EasyMotion.vim b/autoload/EasyMotion.vim index 1c596ee..4b777a8 100644 --- a/autoload/EasyMotion.vim +++ b/autoload/EasyMotion.vim @@ -237,7 +237,16 @@ endfunction "}}} endif endfunction "}}} + function! EasyMotion#User(pattern, visualmode, direction) " {{{ + let re = escape(a:pattern, '|') + call s:EasyMotion(re, a:direction, a:visualmode ? visualmode() : '', mode(1)) + endfunction " }}} + function! EasyMotion#UserMapping(re, mapping, direction) " {{{ + silent exec "nnoremap ".a:mapping." :call EasyMotion#User('".a:re."', 0, ".a:direction.")" + silent exec "onoremap ".a:mapping." :call EasyMotion#User('".a:re."', 0, ".a:direction.")" + silent exec "vnoremap ".a:mapping." :call EasyMotion#User('".a:re."', 0,".a:direction.")" + endfunction " }}} " }}} " Helper functions {{{ function! s:Message(message) " {{{