Skip to content

Commit ef20af2

Browse files
jvfranklinvim-scripts
authored andcommitted
Version 1.10: Add shortcuts for commenting/uncommenting selections.
1 parent 6dbc984 commit ef20af2

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

plugin/python.vim

+18-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
" -*- vim -*-
22
" FILE: python.vim
3-
" LAST MODIFICATION: 2006-08-18 07:30
3+
" LAST MODIFICATION: 2006-11-07 4:29pm
44
" (C) Copyright 2001-2005 Mikael Berthe <[email protected]>
5-
" Version: 1.9
5+
" Version: 1.10
66

77
" USAGE:
88
"
@@ -20,14 +20,16 @@
2020
" shift commands...
2121
"
2222
" REQUIREMENTS:
23-
" vim (>= 6)
23+
" vim (>= 7)
2424
"
2525
" Shortcuts:
2626
" [[ -- Jump to beginning of block
2727
" ]] -- Jump to end of block
2828
" ]v -- Select (Visual Line Mode) block
2929
" ]< -- Shift block to left
3030
" ]> -- Shift block to right
31+
" ]# -- Comment selection
32+
" ]u -- Uncomment selection
3133
" ]c -- Select current/previous class
3234
" ]f -- Select current/previous function
3335
" ]<up> -- Jump to previous line with the same/lower indentation
@@ -45,6 +47,11 @@ vmap ]< <
4547
map ]> [[V]]>
4648
vmap ]> >
4749
50+
map ]# :call PythonCommentSelection()<CR>
51+
vmap ]# :call PythonCommentSelection()<CR>
52+
map ]u :call PythonUncommentSelection()<CR>
53+
vmap ]u :call PythonUncommentSelection()<CR>
54+
4855
map ]c :call PythonSelectObject("class")<CR>
4956
map ]f :call PythonSelectObject("function")<CR>
5057
@@ -72,14 +79,14 @@ nmenu <silent> &Python.Shift\ Block\ Right<Tab>]>
7279
vmenu <silent> &Python.Shift\ Block\ Right<Tab>]>
7380
\]>
7481
nmenu &Python.-Sep3- :
75-
vmenu <silent> &Python.Comment\ Selection
76-
\:call PythonCommentSelection()<CR>
77-
nmenu <silent> &Python.Comment\ Selection
78-
\:call PythonCommentSelection()<CR>
79-
vmenu <silent> &Python.Uncomment\ Selection
80-
\:call PythonUncommentSelection()<CR>
81-
nmenu <silent> &Python.Uncomment\ Selection
82-
\:call PythonUncommentSelection()<CR>
82+
vmenu <silent> &Python.Comment\ Selection<Tab>]#
83+
\]#
84+
nmenu <silent> &Python.Comment\ Selection<Tab>]#
85+
\]#
86+
vmenu <silent> &Python.Uncomment\ Selection<Tab>]u
87+
\]u
88+
nmenu <silent> &Python.Uncomment\ Selection<Tab>]u
89+
\]u
8390
nmenu &Python.-Sep4- :
8491
nmenu <silent> &Python.Previous\ Class
8592
\:call PythonDec("class", -1)<CR>

0 commit comments

Comments
 (0)