Vim /
CommentingOutARangeOfLinesVim.CommentingOutARangeOfLines HistoryHide minor edits - Show changes to markup September 03, 2005, at 04:35 PM
by
Changed line 10 from:
to:
Changed lines 18-20 from:
map gC :'a,. s/^/ */^M:. to:
map gC :'a,. s/^/ */^M:. s/\(.*\)/\1^V^V^M **************\//^M:'a s/\(.*\)/\/**************^V^V^M\1/^M September 03, 2005, at 04:35 PM
by
Changed lines 12-13 from:
to:
=] Changed lines 16-17 from:
For example: to:
For example:
Changed lines 21-22 from:
to:
=] Changed lines 24-25 from:
to:
September 03, 2005, at 04:34 PM
by
Changed lines 3-4 from:
Whatever method you use to find the line numbers they can be used as a range for a substitute: to:
Whatever method you use to find the line numbers they can be used as a range for a substitute:
Changed lines 7-8 from:
to:
Changed lines 9-11 from:
Move to the last line and issue the following ex: to:
Move to the last line and issue the following ex:
:'a,. s/^/# / September 03, 2005, at 04:33 PM
by
Changed lines 4-6 from:
:xx,yy s/^/# / to:
Changed lines 11-23 from:
:'a,. s/^/# / to:
:'a,. s/^/# / More elaborate sequences of pure old ex commands can also be used to create boxes around C/C++ blocks; but they are really horrid to type every time so they have to be mapped to some key sequence and entails consistently using the same register every time. For example:
map gC :'a,. s/^/ */^M:. maps the sequence gC to a macro which wraps a block of text, from the current line back to the line marked by the "a" in a C style comment like: September 03, 2005, at 04:15 PM
by
Changed line 3 from:
Whatever method you use to find the line numbers they can be used as a range for a substitute \\ to:
Whatever method you use to find the line numbers they can be used as a range for a substitute: \\ Changed line 8 from:
Move to the last line and issue the following ex \\ to:
Move to the last line and issue the following ex: \\ September 03, 2005, at 04:15 PM
by
Changed line 4 from:
command: :xx,yy s/^/# / to:
:xx,yy s/^/# / Changed line 9 from:
command: :'a,. s/^/# / to:
:'a,. s/^/# / September 03, 2005, at 04:14 PM
by
Changed line 4 from:
command: :xx,yy s/^/# / to:
command: :xx,yy s/^/# / Changed line 9 from:
"command:" :'a,. s/^/# / to:
command: :'a,. s/^/# / September 03, 2005, at 04:14 PM
by
Changed line 9 from:
"command:" :'a,. s/^/# / to:
"command:" :'a,. s/^/# / September 03, 2005, at 04:14 PM
by
Changed line 4 from:
command: :xx,yy s/^/# / to:
command: :xx,yy s/^/# / September 03, 2005, at 04:13 PM
by
Changed line 4 from:
"command:" :xx,yy s/^/# / to:
command: :xx,yy s/^/# / September 03, 2005, at 04:08 PM
by
Changed lines 4-6 from:
command: "":xx,yy s/^/# /""
to:
"command:" :xx,yy s/^/# /
Changed line 9 from:
command: "":'a,. s/^/# /"" to:
"command:" :'a,. s/^/# / September 03, 2005, at 04:08 PM
by
Changed lines 5-6 from:
to:
September 03, 2005, at 04:07 PM
by
Changed lines 4-6 from:
command: :xx,yy s/^/# /
\\ to:
command: "":xx,yy s/^/# /""
Changed line 9 from:
command: :'a,. s/^/# / to:
command: "":'a,. s/^/# /"" September 03, 2005, at 04:06 PM
by
Added lines 1-9:
Tip #981: Commenting out a range of linesWhatever method you use to find the line numbers they can be used as a range for a substitute |