From ef20af29a94e0db5de36c4d0cfae781be4040903 Mon Sep 17 00:00:00 2001 From: Jon Franklin Date: Wed, 8 Nov 2006 00:00:00 +0000 Subject: [PATCH] Version 1.10: Add shortcuts for commenting/uncommenting selections. --- plugin/python.vim | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/plugin/python.vim b/plugin/python.vim index 4a04686..d4fdc87 100644 --- a/plugin/python.vim +++ b/plugin/python.vim @@ -1,8 +1,8 @@ " -*- vim -*- " FILE: python.vim -" LAST MODIFICATION: 2006-08-18 07:30 +" LAST MODIFICATION: 2006-11-07 4:29pm " (C) Copyright 2001-2005 Mikael Berthe -" Version: 1.9 +" Version: 1.10 " USAGE: " @@ -20,7 +20,7 @@ " shift commands... " " REQUIREMENTS: -" vim (>= 6) +" vim (>= 7) " " Shortcuts: " [[ -- Jump to beginning of block @@ -28,6 +28,8 @@ " ]v -- Select (Visual Line Mode) block " ]< -- Shift block to left " ]> -- Shift block to right +" ]# -- Comment selection +" ]u -- Uncomment selection " ]c -- Select current/previous class " ]f -- Select current/previous function " ] -- Jump to previous line with the same/lower indentation @@ -45,6 +47,11 @@ vmap ]< < map ]> [[V]]> vmap ]> > +map ]# :call PythonCommentSelection() +vmap ]# :call PythonCommentSelection() +map ]u :call PythonUncommentSelection() +vmap ]u :call PythonUncommentSelection() + map ]c :call PythonSelectObject("class") map ]f :call PythonSelectObject("function") @@ -72,14 +79,14 @@ nmenu &Python.Shift\ Block\ Right]> vmenu &Python.Shift\ Block\ Right]> \]> nmenu &Python.-Sep3- : -vmenu &Python.Comment\ Selection - \:call PythonCommentSelection() -nmenu &Python.Comment\ Selection - \:call PythonCommentSelection() -vmenu &Python.Uncomment\ Selection - \:call PythonUncommentSelection() -nmenu &Python.Uncomment\ Selection - \:call PythonUncommentSelection() +vmenu &Python.Comment\ Selection]# + \]# +nmenu &Python.Comment\ Selection]# + \]# +vmenu &Python.Uncomment\ Selection]u + \]u +nmenu &Python.Uncomment\ Selection]u + \]u nmenu &Python.-Sep4- : nmenu &Python.Previous\ Class \:call PythonDec("class", -1)