From aa7b20f3f4b26c0a4989c7ad51b428bed708b639 Mon Sep 17 00:00:00 2001 From: mduan Date: Wed, 2 May 2012 13:31:18 -0400 Subject: [PATCH] updated map to noremap and changed some mappings --- {plugin => ftplugin}/python_fn.vim | 64 ++++++++++++++++-------------- 1 file changed, 34 insertions(+), 30 deletions(-) rename {plugin => ftplugin}/python_fn.vim (89%) diff --git a/plugin/python_fn.vim b/ftplugin/python_fn.vim similarity index 89% rename from plugin/python_fn.vim rename to ftplugin/python_fn.vim index 7c7cf21..d97637f 100644 --- a/plugin/python_fn.vim +++ b/ftplugin/python_fn.vim @@ -27,8 +27,9 @@ " vim (>= 7) " " Shortcuts: -" ]t -- Jump to beginning of block -" ]e -- Jump to end of block +" These are probably wrong now +" ]K -- Jump to beginning of block +" ]J -- Jump to end of block " ]v -- Select (Visual Line Mode) block " ]< -- Shift block to left " ]> -- Shift block to right @@ -36,8 +37,8 @@ " ]u -- Uncomment selection " ]c -- Select current/previous class " ]d -- Select current/previous function -" ] -- Jump to previous line with the same/lower indentation -" ] -- Jump to next line with the same/lower indentation +" ]k -- Jump to previous line with the same/lower indentation +" ]j -- Jump to next line with the same/lower indentation " Only do this when not done yet for this buffer if exists("b:loaded_py_ftplugin") @@ -45,44 +46,47 @@ if exists("b:loaded_py_ftplugin") endif let b:loaded_py_ftplugin = 1 -map ]t :PBoB -vmap ]t :PBOBm'gv`` -map ]e :PEoB -vmap ]e :PEoBm'gv`` +noremap ]K :PBoB +vnoremap ]K :PBoBm'gv`` +noremap ]J :PEoB +vnoremap ]J :PEoBm'gv`` -map ]v ]tV]e -map ]< ]tV]e< -vmap ]< < -map ]> ]tV]e> -vmap ]> > +"noremap ] :call PythonNextLine(-1) +"noremap ] :call PythonNextLine(1) +noremap ]k :call PythonNextLine(-1) +vnoremap ]k :call PythonNextLine(-1)m'gv`` +noremap ]j :call PythonNextLine(1) +vnoremap ]j :call PythonNextLine(1)m'gv`` -map ]# :call PythonCommentSelection() -vmap ]# :call PythonCommentSelection() -map ]u :call PythonUncommentSelection() -vmap ]u :call PythonUncommentSelection() +noremap ]v ]tV]e +noremap ]< ]tV]e< +vnoremap ]< < +noremap ]> ]tV]e> +vnoremap ]> > -map ]c :call PythonSelectObject("class") -map ]d :call PythonSelectObject("function") +noremap ]# :call PythonCommentSelection() +vnoremap ]# :call PythonCommentSelection() +noremap ]u :call PythonUncommentSelection() +vnoremap ]u :call PythonUncommentSelection() -map ] :call PythonNextLine(-1) -map ] :call PythonNextLine(1) -" You may prefer use and ... :-) +noremap ]c :call PythonSelectObject("class") +noremap ]d :call PythonSelectObject("function") " jump to previous class -map ]J :call PythonDec("class", -1) -vmap ]J :call PythonDec("class", -1) +noremap ]t :call PythonDec("class", -1) +vnoremap ]t :call PythonDec("class", -1) " jump to next class -map ]j :call PythonDec("class", 1) -vmap ]j :call PythonDec("class", 1) +noremap ]e :call PythonDec("class", 1) +vnoremap ]e :call PythonDec("class", 1) " jump to previous function -map ]F :call PythonDec("function", -1) -vmap ]F :call PythonDec("function", -1) +noremap ]F :call PythonDec("function", -1) +vnoremap ]F :call PythonDec("function", -1) " jump to next function -map ]f :call PythonDec("function", 1) -vmap ]f :call PythonDec("function", 1) +noremap ]f :call PythonDec("function", 1) +vnoremap ]f :call PythonDec("function", 1)