From ea8da5c03ddc297593f61b124d81f9fa320bd491 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Thu, 13 Feb 2014 10:56:38 +0900 Subject: [PATCH] Remove init.vim --- autoload/EasyMotion/init.vim | 28 ---------------------------- plugin/EasyMotion.vim | 29 ++++++++++++++++++++--------- 2 files changed, 20 insertions(+), 37 deletions(-) delete mode 100644 autoload/EasyMotion/init.vim diff --git a/autoload/EasyMotion/init.vim b/autoload/EasyMotion/init.vim deleted file mode 100644 index a6c8f99..0000000 --- a/autoload/EasyMotion/init.vim +++ /dev/null @@ -1,28 +0,0 @@ -" Saving 'cpoptions' {{{ -let s:save_cpo = &cpo -set cpo&vim -" }}} - -function! EasyMotion#init#InitMappings(motions, do_mapping) "{{{ - for [motion, fn] in items(a:motions) - " Mapping {{{ - if exists('g:EasyMotion_mapping_' . motion) - " Backward compatible mapping [deprecated] - silent exec 'map ' . - \ eval('g:EasyMotion_mapping_' . motion) . ' (easymotion-' . motion . ')' - elseif a:do_mapping - \ && !hasmapto('(easymotion-' . motion . ')') - \ && empty(maparg('(easymotion-prefix)' . motion, 'nov')) - - " Do mapping - silent exec 'map ' . - \'(easymotion-prefix)' . motion . ' (easymotion-' . motion . ')' - endif "}}} - endfor -endfunction "}}} - -" Restore 'cpoptions' {{{ -let &cpo = s:save_cpo -unlet s:save_cpo -" }}} -" vim: fdm=marker:et:ts=4:sw=4:sts=4 diff --git a/plugin/EasyMotion.vim b/plugin/EasyMotion.vim index 9ecccfe..ac03064 100644 --- a/plugin/EasyMotion.vim +++ b/plugin/EasyMotion.vim @@ -3,7 +3,7 @@ " Author: Kim Silkebækken " haya14busa " Source: https://github.com/Lokaltog/vim-easymotion -" Last Change: 12 Feb 2014. +" Last Change: 13 Feb 2014. " == Script initialization {{{ if expand("%:p") ==# expand(":p") unlet! g:EasyMotion_loaded @@ -261,13 +261,6 @@ xnoremap (easymotion-lineanywhere) "}}} "}}} -" map (easymotion-clever-s) -" \ EasyMotion#is_active() ? '(easymotion-next)' : '(easymotion-s)' -" map (easymotion-clever-s2) -" \ EasyMotion#is_active() ? '(easymotion-next)' : '(easymotion-s2)' -" map (easymotion-clever-sn) -" \ EasyMotion#is_active() ? '(easymotion-next)' : '(easymotion-sn)' - noremap (easymotion-activate) :call EasyMotion#activate(0) xnoremap (easymotion-activate) :call EasyMotion#activate(1) @@ -285,8 +278,26 @@ if g:EasyMotion_do_mapping == 1 endif "}}} + function! s:default_mapping(motions, do_mapping) "{{{ + for [motion, fn] in items(a:motions) + " Mapping {{{ + if exists('g:EasyMotion_mapping_' . motion) + " Backward compatible mapping [deprecated] + silent exec 'map ' . + \ eval('g:EasyMotion_mapping_' . motion) . ' (easymotion-' . motion . ')' + elseif a:do_mapping + \ && !hasmapto('(easymotion-' . motion . ')') + \ && empty(maparg('(easymotion-prefix)' . motion, 'nov')) + + " Do mapping + silent exec 'map ' . + \'(easymotion-prefix)' . motion . ' (easymotion-' . motion . ')' + endif "}}} + endfor + endfunction "}}} + " Default Mapping: - call EasyMotion#init#InitMappings({ + call s:default_mapping({ \ 'f' : { 'name': 'S' , 'dir': 0 } \ , 'F' : { 'name': 'S' , 'dir': 1 } \ , 's' : { 'name': 'S' , 'dir': 2 }