mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-11-08 18:03:46 -05:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a84365f174 | ||
|
|
1fc1decbe9 | ||
|
|
dc8275ffa0 | ||
|
|
64f0798984 | ||
|
|
01f8df684c | ||
|
|
7c830eb223 | ||
|
|
af0d51d8b3 | ||
|
|
650396b1fc | ||
|
|
cf54bfc7c4 | ||
|
|
6b2cc6c41d | ||
|
|
e52840527a | ||
|
|
dee2021b8f | ||
|
|
2da9787ff1 | ||
|
|
fef5db7e92 | ||
|
|
875831209a | ||
|
|
191bb50879 | ||
|
|
e92b6f60d5 | ||
|
|
3eea85daa4 |
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
CONTENTS *NERDCommenterContents*
|
CONTENTS *NERDCommenterContents*
|
||||||
|
|
||||||
1.Intro...................................|NERDCommenter|
|
1.Intro...................................|NERDCommenter|
|
||||||
2.Functionality provided..................|NERDComFunctionality|
|
2.Functionality provided..................|NERDComFunctionality|
|
||||||
@@ -16,8 +16,8 @@ CONTENTS *NERDCommenterContents*
|
|||||||
2.2 Functionality Details.............|NERDComFunctionalityDetails|
|
2.2 Functionality Details.............|NERDComFunctionalityDetails|
|
||||||
2.2.1 Comment map.................|NERDComComment|
|
2.2.1 Comment map.................|NERDComComment|
|
||||||
2.2.2 Nested comment map..........|NERDComNestedComment|
|
2.2.2 Nested comment map..........|NERDComNestedComment|
|
||||||
2.2.3 Toggle comment map..........|NERDComToggleComment|
|
2.2.3 Toggle comment map..........|NERDComToggleComment|
|
||||||
2.2.4 Minimal comment map.........|NERDComMinimalComment|
|
2.2.4 Minimal comment map.........|NERDComMinimalComment|
|
||||||
2.2.5 Invert comment map..........|NERDComInvertComment|
|
2.2.5 Invert comment map..........|NERDComInvertComment|
|
||||||
2.2.6 Sexy comment map............|NERDComSexyComment|
|
2.2.6 Sexy comment map............|NERDComSexyComment|
|
||||||
2.2.7 Yank comment map............|NERDComYankComment|
|
2.2.7 Yank comment map............|NERDComYankComment|
|
||||||
@@ -40,9 +40,9 @@ CONTENTS *NERDCommenterContents*
|
|||||||
4.1 Delimiter detection heuristics....|NERDComHeuristics|
|
4.1 Delimiter detection heuristics....|NERDComHeuristics|
|
||||||
4.2 Nesting issues....................|NERDComNesting|
|
4.2 Nesting issues....................|NERDComNesting|
|
||||||
5.The author..............................|NERDComAuthor|
|
5.The author..............................|NERDComAuthor|
|
||||||
6.TODO list...............................|NERDComTodo|
|
6.Changelog...............................|NERDComChangelog|
|
||||||
7.Changelog...............................|NERDComChangelog|
|
7.Credits.................................|NERDComCredits|
|
||||||
8.Credits.................................|NERDComCredits|
|
8.License.................................|NERDComLicense|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Intro *NERDCommenter*
|
1. Intro *NERDCommenter*
|
||||||
@@ -66,29 +66,29 @@ provided that contains menu items corresponding to all the below mappings):
|
|||||||
Most of the following mappings are for normal/visual mode only. The
|
Most of the following mappings are for normal/visual mode only. The
|
||||||
|NERDComInsertComment| mapping is for insert mode only.
|
|NERDComInsertComment| mapping is for insert mode only.
|
||||||
|
|
||||||
[count],cc |NERDComComment|
|
[count],cc |NERDComComment|
|
||||||
Comments out the current line or text selected in visual mode.
|
Comments out the current line or text selected in visual mode.
|
||||||
|
|
||||||
|
|
||||||
[count],cn |NERDComNestedComment|
|
[count],cn |NERDComNestedComment|
|
||||||
Same as |NERDComComment| but forces nesting.
|
Same as |NERDComComment| but forces nesting.
|
||||||
|
|
||||||
[count],c<space> |NERDComToggleComment|
|
[count],c<space> |NERDComToggleComment|
|
||||||
Toggles the comment state of the selected line(s). If the topmost selected
|
Toggles the comment state of the selected line(s). If the topmost selected
|
||||||
line is commented, all selected lines are uncommented and vice versa.
|
line is commented, all selected lines are uncommented and vice versa.
|
||||||
|
|
||||||
|
|
||||||
[count],cm |NERDComMinimalComment|
|
[count],cm |NERDComMinimalComment|
|
||||||
Comments the given lines using only one set of multipart delimiters if
|
Comments the given lines using only one set of multipart delimiters if
|
||||||
possible.
|
possible.
|
||||||
|
|
||||||
|
|
||||||
[count],ci |NERDComInvertComment|
|
[count],ci |NERDComInvertComment|
|
||||||
Toggles the comment state of the selected line(s) individually. Each selected
|
Toggles the comment state of the selected line(s) individually. Each selected
|
||||||
line that is commented is uncommented and vice versa.
|
line that is commented is uncommented and vice versa.
|
||||||
|
|
||||||
|
|
||||||
[count],cs |NERDComSexyComment|
|
[count],cs |NERDComSexyComment|
|
||||||
Comments out the selected lines ``sexily''
|
Comments out the selected lines ``sexily''
|
||||||
|
|
||||||
|
|
||||||
@@ -97,37 +97,37 @@ Same as |NERDComComment| except that the commented line(s) are yanked
|
|||||||
before commenting.
|
before commenting.
|
||||||
|
|
||||||
|
|
||||||
,c$ |NERDComEOLComment|
|
,c$ |NERDComEOLComment|
|
||||||
Comments the current line from the cursor to the end of line.
|
Comments the current line from the cursor to the end of line.
|
||||||
|
|
||||||
|
|
||||||
,cA |NERDComAppendComment|
|
,cA |NERDComAppendComment|
|
||||||
Adds comment delimiters to the end of line and goes into insert mode between
|
Adds comment delimiters to the end of line and goes into insert mode between
|
||||||
them.
|
them.
|
||||||
|
|
||||||
|
|
||||||
,cI |NERDComPrependComment|
|
,cI |NERDComPrependComment|
|
||||||
Adds comment delimiters to the start of line and goes into insert mode between
|
Adds comment delimiters to the start of line and goes into insert mode between
|
||||||
them.
|
them.
|
||||||
|
|
||||||
|
|
||||||
<C-c> |NERDComInsertComment|
|
<C-c> |NERDComInsertComment|
|
||||||
Adds comment delimiters at the current cursor position and inserts between.
|
Adds comment delimiters at the current cursor position and inserts between.
|
||||||
|
|
||||||
|
|
||||||
,ca |NERDComAltDelim|
|
,ca |NERDComAltDelim|
|
||||||
Switches to the alternative set of delimiters.
|
Switches to the alternative set of delimiters.
|
||||||
|
|
||||||
|
|
||||||
[count],cl
|
[count],cl
|
||||||
[count],cr
|
[count],cr
|
||||||
[count],cb |NERDComAlignedComment|
|
[count],cb |NERDComAlignedComment|
|
||||||
Same as |NERDComComment| except that the delimiters are aligned down the
|
Same as |NERDComComment| except that the delimiters are aligned down the
|
||||||
left side (,cl), the right side (,cr) or both sides
|
left side (,cl), the right side (,cr) or both sides
|
||||||
(,cb).
|
(,cb).
|
||||||
|
|
||||||
|
|
||||||
[count],cu |NERDComUncommentLine|
|
[count],cu |NERDComUncommentLine|
|
||||||
Uncomments the selected line(s).
|
Uncomments the selected line(s).
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
@@ -137,8 +137,8 @@ Uncomments the selected line(s).
|
|||||||
2.2.1 Comment map *NERDComComment*
|
2.2.1 Comment map *NERDComComment*
|
||||||
|
|
||||||
Default mapping: [count],cc
|
Default mapping: [count],cc
|
||||||
Change the mapping with: NERDComLineMap.
|
Change the mapping with: NERDComLineMap.
|
||||||
Applicable modes: normal visual visual-line visual-block.
|
Applicable modes: normal visual visual-line visual-block.
|
||||||
|
|
||||||
|
|
||||||
Comments out the current line. If multiple lines are selected in visual-line
|
Comments out the current line. If multiple lines are selected in visual-line
|
||||||
@@ -157,12 +157,12 @@ Change the mapping with: NERDComLineNestMap.
|
|||||||
Applicable modes: normal visual visual-line visual-block.
|
Applicable modes: normal visual visual-line visual-block.
|
||||||
|
|
||||||
Performs nested commenting. Works the same as ,cc except that if a
|
Performs nested commenting. Works the same as ,cc except that if a
|
||||||
line is already commented then it will be commented again.
|
line is already commented then it will be commented again.
|
||||||
|
|
||||||
If |NERDUsePlaceHolders| is set then the previous comment delimiters will
|
If |NERDUsePlaceHolders| is set then the previous comment delimiters will
|
||||||
be replaced by place-holder delimiters if needed. Otherwise the nested
|
be replaced by place-holder delimiters if needed. Otherwise the nested
|
||||||
comment will only be added if the current commenting delimiters have no right
|
comment will only be added if the current commenting delimiters have no right
|
||||||
delimiter (to avoid syntax errors)
|
delimiter (to avoid syntax errors)
|
||||||
|
|
||||||
If a [count] is given in normal mode, the mapping works as though that many
|
If a [count] is given in normal mode, the mapping works as though that many
|
||||||
lines were selected in visual-line mode.
|
lines were selected in visual-line mode.
|
||||||
@@ -171,15 +171,15 @@ Related options:
|
|||||||
|NERDDefaultNesting|
|
|NERDDefaultNesting|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.3 Toggle comment map *NERDComToggleComment*
|
2.2.3 Toggle comment map *NERDComToggleComment*
|
||||||
|
|
||||||
Default mapping: [count],c<space>
|
Default mapping: [count],c<space>
|
||||||
Change the mapping with: NERDComLineToggleMap.
|
Change the mapping with: NERDComLineToggleMap.
|
||||||
Applicable modes: normal visual-line.
|
Applicable modes: normal visual-line.
|
||||||
|
|
||||||
Toggles commenting of the lines selected. The behaviour of this mapping
|
Toggles commenting of the lines selected. The behaviour of this mapping
|
||||||
depends on whether the first line selected is commented or not. If so, all
|
depends on whether the first line selected is commented or not. If so, all
|
||||||
selected lines are uncommented and vice versa.
|
selected lines are uncommented and vice versa.
|
||||||
|
|
||||||
With this mapping, a line is only considered to be commented if it starts with
|
With this mapping, a line is only considered to be commented if it starts with
|
||||||
a left delimiter.
|
a left delimiter.
|
||||||
@@ -188,7 +188,7 @@ If a [count] is given in normal mode, the mapping works as though that many
|
|||||||
lines were selected in visual-line mode.
|
lines were selected in visual-line mode.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.4 Minimal comment map *NERDComMinimalComment*
|
2.2.4 Minimal comment map *NERDComMinimalComment*
|
||||||
|
|
||||||
Default mapping: [count],cm
|
Default mapping: [count],cm
|
||||||
Change the mapping with: NERDComLineMinimalMap
|
Change the mapping with: NERDComLineMinimalMap
|
||||||
@@ -212,13 +212,13 @@ lines were selected in visual-line mode.
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.5 Invert comment map *NERDComInvertComment*
|
2.2.5 Invert comment map *NERDComInvertComment*
|
||||||
|
|
||||||
Default mapping: ,ci
|
Default mapping: ,ci
|
||||||
Change the mapping with: NERDComLineInvertMap.
|
Change the mapping with: NERDComLineInvertMap.
|
||||||
Applicable modes: normal visual-line.
|
Applicable modes: normal visual-line.
|
||||||
|
|
||||||
Inverts the commented state of each selected line. If the a selected line is
|
Inverts the commented state of each selected line. If the a selected line is
|
||||||
commented then it is uncommented and vice versa. Each line is examined and
|
commented then it is uncommented and vice versa. Each line is examined and
|
||||||
commented/uncommented individually.
|
commented/uncommented individually.
|
||||||
|
|
||||||
With this mapping, a line is only considered to be commented if it starts with
|
With this mapping, a line is only considered to be commented if it starts with
|
||||||
a left delimiter.
|
a left delimiter.
|
||||||
@@ -229,13 +229,13 @@ lines were selected in visual-line mode.
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.6 Sexy comment map *NERDComSexyComment*
|
2.2.6 Sexy comment map *NERDComSexyComment*
|
||||||
|
|
||||||
Default mapping: [count],cs
|
Default mapping: [count],cs
|
||||||
Change the mapping with: NERDComLineSexyMap
|
Change the mapping with: NERDComLineSexyMap
|
||||||
Applicable modes: normal, visual-line.
|
Applicable modes: normal, visual-line.
|
||||||
|
|
||||||
Comments the selected line(s) ``sexily''... see |NERDComSexyComments| for
|
Comments the selected line(s) ``sexily''... see |NERDComSexyComments| for
|
||||||
a description of what sexy comments are. Can only be done on filetypes for
|
a description of what sexy comments are. Can only be done on filetypes for
|
||||||
which there is at least one set of multipart comment delimiters specified.
|
which there is at least one set of multipart comment delimiters specified.
|
||||||
|
|
||||||
Sexy comments cannot be nested and lines inside a sexy comment cannot be
|
Sexy comments cannot be nested and lines inside a sexy comment cannot be
|
||||||
commented again.
|
commented again.
|
||||||
@@ -249,31 +249,31 @@ Related options:
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.7 Yank comment map *NERDComYankComment*
|
2.2.7 Yank comment map *NERDComYankComment*
|
||||||
|
|
||||||
Default mapping: [count],cy
|
Default mapping: [count],cy
|
||||||
Change the mapping with: NERDComLineYankMap
|
Change the mapping with: NERDComLineYankMap
|
||||||
Applicable modes: normal visual visual-line visual-block.
|
Applicable modes: normal visual visual-line visual-block.
|
||||||
|
|
||||||
Same as ,cc except that it yanks the line(s) that are commented first.
|
Same as ,cc except that it yanks the line(s) that are commented first.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.8 Comment to EOL map *NERDComEOLComment*
|
2.2.8 Comment to EOL map *NERDComEOLComment*
|
||||||
|
|
||||||
Default mapping: ,c$
|
Default mapping: ,c$
|
||||||
Change the mapping with: NERDComToEOLMap
|
Change the mapping with: NERDComToEOLMap
|
||||||
Applicable modes: normal.
|
Applicable modes: normal.
|
||||||
|
|
||||||
Comments the current line from the current cursor position up to the end of
|
Comments the current line from the current cursor position up to the end of
|
||||||
the line.
|
the line.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.9 Append com to line map *NERDComAppendComment*
|
2.2.9 Append com to line map *NERDComAppendComment*
|
||||||
|
|
||||||
Default mapping: ,cA
|
Default mapping: ,cA
|
||||||
Change the mapping with: NERDAppendComMap.
|
Change the mapping with: NERDAppendComMap.
|
||||||
Applicable modes: normal.
|
Applicable modes: normal.
|
||||||
|
|
||||||
Appends comment delimiters to the end of the current line and goes
|
Appends comment delimiters to the end of the current line and goes
|
||||||
to insert mode between the new delimiters.
|
to insert mode between the new delimiters.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.10 Prepend com to line map *NERDComPrependComment*
|
2.2.10 Prepend com to line map *NERDComPrependComment*
|
||||||
@@ -283,17 +283,17 @@ Change the mapping with: NERDPrependComMap.
|
|||||||
Applicable modes: normal.
|
Applicable modes: normal.
|
||||||
|
|
||||||
Prepends comment delimiters to the start of the current line and goes to
|
Prepends comment delimiters to the start of the current line and goes to
|
||||||
insert mode between the new delimiters.
|
insert mode between the new delimiters.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.11 Insert comment map *NERDComInsertComment*
|
2.2.11 Insert comment map *NERDComInsertComment*
|
||||||
|
|
||||||
Default mapping: <C-c>
|
Default mapping: <C-c>
|
||||||
Change the mapping with: NERDComInInsertMap.
|
Change the mapping with: NERDComInInsertMap.
|
||||||
Applicable modes: insert.
|
Applicable modes: insert.
|
||||||
|
|
||||||
Adds comment delimiters at the current cursor position and inserts
|
Adds comment delimiters at the current cursor position and inserts
|
||||||
between them.
|
between them.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.12 Use alternate delims map *NERDComAltDelim*
|
2.2.12 Use alternate delims map *NERDComAltDelim*
|
||||||
@@ -304,21 +304,21 @@ Applicable modes: normal.
|
|||||||
|
|
||||||
Changes to the alternative commenting style if one is available. For example,
|
Changes to the alternative commenting style if one is available. For example,
|
||||||
if the user is editing a c++ file using // comments and they hit ,ca
|
if the user is editing a c++ file using // comments and they hit ,ca
|
||||||
then they will be switched over to /**/ comments.
|
then they will be switched over to /**/ comments.
|
||||||
|
|
||||||
See also |NERDComDefaultDelims|
|
See also |NERDComDefaultDelims|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.13 Comment aligned maps *NERDComAlignedComment*
|
2.2.13 Comment aligned maps *NERDComAlignedComment*
|
||||||
|
|
||||||
Default mappings: [count],cl [count],cr [count],cb
|
Default mappings: [count],cl [count],cr [count],cb
|
||||||
Change the mappings with: NERDComAlignLeftMap, NERDComAlignRightMap and
|
Change the mappings with: NERDComAlignLeftMap, NERDComAlignRightMap and
|
||||||
NERDComAlignBothMap.
|
NERDComAlignBothMap.
|
||||||
Applicable modes: normal visual-line.
|
Applicable modes: normal visual-line.
|
||||||
|
|
||||||
Same as ,cc except that the comment delimiters are aligned on the left
|
Same as ,cc except that the comment delimiters are aligned on the left
|
||||||
side, right side or both sides respectively. These comments are always nested
|
side, right side or both sides respectively. These comments are always nested
|
||||||
if the line(s) are already commented.
|
if the line(s) are already commented.
|
||||||
|
|
||||||
If a [count] is given in normal mode, the mapping works as though that many
|
If a [count] is given in normal mode, the mapping works as though that many
|
||||||
lines were selected in visual-line mode.
|
lines were selected in visual-line mode.
|
||||||
@@ -326,7 +326,7 @@ lines were selected in visual-line mode.
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.14 Uncomment line map *NERDComUncommentLine*
|
2.2.14 Uncomment line map *NERDComUncommentLine*
|
||||||
|
|
||||||
Default mapping: [count],cu
|
Default mapping: [count],cu
|
||||||
Change the mapping with: NERDUncomLineMap.
|
Change the mapping with: NERDUncomLineMap.
|
||||||
Applicable modes: normal visual visual-line visual-block.
|
Applicable modes: normal visual visual-line visual-block.
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ strace svn systemverilog tads taglist tags tak tasm tcl terminfo tex text
|
|||||||
plaintex texinfo texmf tf tidy tli trasys tsalt tsscl tssgm uc uil vb verilog
|
plaintex texinfo texmf tf tidy tli trasys tsalt tsscl tssgm uc uil vb verilog
|
||||||
verilog_systemverilog vgrindefs vhdl vim viminfo virata vo_base vrml vsejcl
|
verilog_systemverilog vgrindefs vhdl vim viminfo virata vo_base vrml vsejcl
|
||||||
webmacro wget winbatch wml wvdial xdefaults xf86conf xhtml xkb xmath xml
|
webmacro wget winbatch wml wvdial xdefaults xf86conf xhtml xkb xmath xml
|
||||||
xmodmap xpm2 xpm xslt yacc yaml z8a
|
xmodmap xpm2 xpm xslt yacc yaml z8a
|
||||||
|
|
||||||
If a language is not in the list of hardcoded supported filetypes then the
|
If a language is not in the list of hardcoded supported filetypes then the
|
||||||
&commentstring vim option is used.
|
&commentstring vim option is used.
|
||||||
@@ -390,7 +390,7 @@ one other marker symbol. For example: >
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* This is a c style sexy comment
|
/* This is a c style sexy comment
|
||||||
* So there!
|
* So there!
|
||||||
* But this one is ``compact'' style */
|
* But this one is ``compact'' style */
|
||||||
<
|
<
|
||||||
Here the multipart delimiters are /* and */ and the marker is *. The NERD
|
Here the multipart delimiters are /* and */ and the marker is *. The NERD
|
||||||
@@ -402,9 +402,9 @@ commenter is capable of adding and removing comments of this type.
|
|||||||
All of the NERD commenter mappings and menu items invoke a single function
|
All of the NERD commenter mappings and menu items invoke a single function
|
||||||
which delegates the commenting work to other functions. This function is
|
which delegates the commenting work to other functions. This function is
|
||||||
public and has the prototype: >
|
public and has the prototype: >
|
||||||
function! NERDComment(isVisual, type)
|
function! NERDComment(isVisual, type)
|
||||||
<
|
<
|
||||||
The arguments to this function are simple:
|
The arguments to this function are simple:
|
||||||
- isVisual: if you wish to do any kind of visual comment then set this to
|
- isVisual: if you wish to do any kind of visual comment then set this to
|
||||||
1 and the function will use the '< and '> marks to find the comment
|
1 and the function will use the '< and '> marks to find the comment
|
||||||
boundries. If set to 0 then the function will operate on the current
|
boundries. If set to 0 then the function will operate on the current
|
||||||
@@ -418,7 +418,7 @@ For example, if you typed >
|
|||||||
:call NERDComment(1, 'sexy')
|
:call NERDComment(1, 'sexy')
|
||||||
<
|
<
|
||||||
then the script would do a sexy comment on the last visual selection.
|
then the script would do a sexy comment on the last visual selection.
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
3. Options *NERDComOptions*
|
3. Options *NERDComOptions*
|
||||||
@@ -450,7 +450,7 @@ then the script would do a sexy comment on the last visual selection.
|
|||||||
|NERDRemoveExtraSpaces| Tells the script to always remove the
|
|NERDRemoveExtraSpaces| Tells the script to always remove the
|
||||||
extra spaces when uncommenting
|
extra spaces when uncommenting
|
||||||
(regardless of whether NERDSpaceDelims
|
(regardless of whether NERDSpaceDelims
|
||||||
is set)
|
is set)
|
||||||
|NERDRPlace| Specifies what to use as the right
|
|NERDRPlace| Specifies what to use as the right
|
||||||
delimiter placeholder when nesting
|
delimiter placeholder when nesting
|
||||||
comments.
|
comments.
|
||||||
@@ -466,7 +466,7 @@ then the script would do a sexy comment on the last visual selection.
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
3.3 Options details *NERDComOptionsDetails*
|
3.3 Options details *NERDComOptionsDetails*
|
||||||
|
|
||||||
To enable any of the below options you should put the given line in your
|
To enable any of the below options you should put the given line in your
|
||||||
~/.vimrc
|
~/.vimrc
|
||||||
|
|
||||||
*loaded_nerd_comments*
|
*loaded_nerd_comments*
|
||||||
@@ -476,7 +476,7 @@ option >
|
|||||||
<
|
<
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*NERDAllowAnyVisualDelims*
|
*NERDAllowAnyVisualDelims*
|
||||||
Values: 0 or 1.
|
Values: 0 or 1.
|
||||||
Default: 1.
|
Default: 1.
|
||||||
|
|
||||||
If set to 1 then, when doing a visual or visual-block comment (but not a
|
If set to 1 then, when doing a visual or visual-block comment (but not a
|
||||||
@@ -489,7 +489,7 @@ example if we are editing the following java code: >
|
|||||||
System.out.println(foo * bar);
|
System.out.println(foo * bar);
|
||||||
<
|
<
|
||||||
If we are using // comments and select the "foo" and "bar" in visual-block
|
If we are using // comments and select the "foo" and "bar" in visual-block
|
||||||
mode, as shown left below (where '|'s are used to represent the visual-block
|
mode, as shown left below (where '|'s are used to represent the visual-block
|
||||||
boundary), and comment it then the script will use the alternative delims as
|
boundary), and comment it then the script will use the alternative delims as
|
||||||
shown on the right: >
|
shown on the right: >
|
||||||
|
|
||||||
@@ -499,7 +499,7 @@ shown on the right: >
|
|||||||
<
|
<
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*NERDBlockComIgnoreEmpty*
|
*NERDBlockComIgnoreEmpty*
|
||||||
Values: 0 or 1.
|
Values: 0 or 1.
|
||||||
Default: 1.
|
Default: 1.
|
||||||
|
|
||||||
This option affects visual-block mode commenting. If this option is turned
|
This option affects visual-block mode commenting. If this option is turned
|
||||||
@@ -516,7 +516,7 @@ For example, if you are commenting this chunk of c code in visual-block mode
|
|||||||
| | while(1){
|
| | while(1){
|
||||||
| | fork();
|
| | fork();
|
||||||
| | }
|
| | }
|
||||||
|} |
|
|} |
|
||||||
<
|
<
|
||||||
If NERDBlockComIgnoreEmpty=0 then this code will become: >
|
If NERDBlockComIgnoreEmpty=0 then this code will become: >
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -527,7 +527,7 @@ If NERDBlockComIgnoreEmpty=0 then this code will become: >
|
|||||||
/* */ while(1){
|
/* */ while(1){
|
||||||
/* */ fork();
|
/* */ fork();
|
||||||
/* */ }
|
/* */ }
|
||||||
/*} */
|
/*} */
|
||||||
<
|
<
|
||||||
Otherwise, the code block would become: >
|
Otherwise, the code block would become: >
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -538,7 +538,7 @@ Otherwise, the code block would become: >
|
|||||||
while(1){
|
while(1){
|
||||||
fork();
|
fork();
|
||||||
}
|
}
|
||||||
/*} */
|
/*} */
|
||||||
<
|
<
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*NERDCommentWholeLinesInVMode*
|
*NERDCommentWholeLinesInVMode*
|
||||||
@@ -629,7 +629,7 @@ set NERDRemoveExtraSpaces to 0.
|
|||||||
*NERDLPlace*
|
*NERDLPlace*
|
||||||
*NERDRPlace*
|
*NERDRPlace*
|
||||||
Values: arbitrary string.
|
Values: arbitrary string.
|
||||||
Default:
|
Default:
|
||||||
NERDLPlace: "[>"
|
NERDLPlace: "[>"
|
||||||
NERDRPlace: "<]"
|
NERDRPlace: "<]"
|
||||||
|
|
||||||
@@ -637,8 +637,8 @@ These options are used to control the strings used as place-holder delimiters.
|
|||||||
Place holder delimiters are used when performing nested commenting when the
|
Place holder delimiters are used when performing nested commenting when the
|
||||||
filetype supports commenting styles with both left and right delimiters.
|
filetype supports commenting styles with both left and right delimiters.
|
||||||
To set these options use lines like: >
|
To set these options use lines like: >
|
||||||
let NERDLPlace="FOO"
|
let NERDLPlace="FOO"
|
||||||
let NERDRPlace="BAR"
|
let NERDRPlace="BAR"
|
||||||
<
|
<
|
||||||
Following the above example, if we have line of c code: >
|
Following the above example, if we have line of c code: >
|
||||||
/* int horse */
|
/* int horse */
|
||||||
@@ -654,7 +654,7 @@ Values: arbitrary string.
|
|||||||
Default: \c
|
Default: \c
|
||||||
|
|
||||||
NERDMapleader is used to specify what all the NERD commenter key mappings
|
NERDMapleader is used to specify what all the NERD commenter key mappings
|
||||||
begin with.
|
begin with.
|
||||||
|
|
||||||
The default key mappings will look like this: >
|
The default key mappings will look like this: >
|
||||||
\cc
|
\cc
|
||||||
@@ -688,7 +688,7 @@ This option can take 4 values:
|
|||||||
"1": Turns the 'comment' menu on with no menu shortcut.
|
"1": Turns the 'comment' menu on with no menu shortcut.
|
||||||
"2": Turns the 'comment 'menu on with <alt>-c as the shortcut.
|
"2": Turns the 'comment 'menu on with <alt>-c as the shortcut.
|
||||||
"3": Turns the 'Plugin -> comment' menu on with <alt>-c as the shortcut.
|
"3": Turns the 'Plugin -> comment' menu on with <alt>-c as the shortcut.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*NERDUsePlaceHolders*
|
*NERDUsePlaceHolders*
|
||||||
Values: 0 or 1.
|
Values: 0 or 1.
|
||||||
@@ -733,10 +733,10 @@ Some people may want their sexy comments to be like this: >
|
|||||||
* in c */
|
* in c */
|
||||||
<
|
<
|
||||||
As opposed to like this: >
|
As opposed to like this: >
|
||||||
/*
|
/*
|
||||||
* Hi There!
|
* Hi There!
|
||||||
* This is a sexy comment
|
* This is a sexy comment
|
||||||
* in c
|
* in c
|
||||||
*/
|
*/
|
||||||
<
|
<
|
||||||
If this option is set to 1 then the top style will be used.
|
If this option is set to 1 then the top style will be used.
|
||||||
@@ -769,11 +769,11 @@ See |NERDComAltDelim| for switching commenting styles at runtime.
|
|||||||
|
|
||||||
These options are used to override the default keys that are used for the
|
These options are used to override the default keys that are used for the
|
||||||
commenting mappings. Their values must be set to strings. As an example: if
|
commenting mappings. Their values must be set to strings. As an example: if
|
||||||
you wanted to use the mapping ,foo to uncomment lines of code then
|
you wanted to use the mapping ,foo to uncomment lines of code then
|
||||||
you would place this line in your vimrc >
|
you would place this line in your vimrc >
|
||||||
let NERDUncomLineMap=",foo"
|
let NERDUncomLineMap=",foo"
|
||||||
<
|
<
|
||||||
Check out |NERDComFunctionality| for details about what the following
|
Check out |NERDComFunctionality| for details about what the following
|
||||||
mappings do.
|
mappings do.
|
||||||
|
|
||||||
Default Mapping Option to override~
|
Default Mapping Option to override~
|
||||||
@@ -793,7 +793,7 @@ Default Mapping Option to override~
|
|||||||
,c$ NERDComToEOLMap
|
,c$ NERDComToEOLMap
|
||||||
,cy NERDComLineYankMap
|
,cy NERDComLineYankMap
|
||||||
,cu NERDUncomLineMap
|
,cu NERDUncomLineMap
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
4. Issues with the script *NERDComIssues*
|
4. Issues with the script *NERDComIssues*
|
||||||
|
|
||||||
@@ -809,7 +809,7 @@ delimiters appear in a line doesnt mean they really ARE delimiters. For
|
|||||||
example, Java uses // comments but the line >
|
example, Java uses // comments but the line >
|
||||||
System.out.println("//");
|
System.out.println("//");
|
||||||
<
|
<
|
||||||
clearly contains no real comment delimiters.
|
clearly contains no real comment delimiters.
|
||||||
|
|
||||||
To distinguish between ``real'' comment delimiters and ``fake'' ones we use a
|
To distinguish between ``real'' comment delimiters and ``fake'' ones we use a
|
||||||
set of heuristics. For example, one such heuristic states that any comment
|
set of heuristics. For example, one such heuristic states that any comment
|
||||||
@@ -839,7 +839,7 @@ will become: >
|
|||||||
for simplicity)
|
for simplicity)
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
6. The author *NERDComAuthor*
|
5. The author *NERDComAuthor*
|
||||||
|
|
||||||
The author of the NERD commenter is Martyzillatron --- the half robot, half
|
The author of the NERD commenter is Martyzillatron --- the half robot, half
|
||||||
dinosaur bastard son of Megatron and Godzilla. He enjoys destroying
|
dinosaur bastard son of Megatron and Godzilla. He enjoys destroying
|
||||||
@@ -850,16 +850,19 @@ its a lonely life being the worlds premier terror machine. How would you feel
|
|||||||
if your face looked like a toaster and a t-rex put together? :(
|
if your face looked like a toaster and a t-rex put together? :(
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
7. TODO list *NERDComTodo*
|
7. Changelog *NERDComChangelog*
|
||||||
|
|
||||||
Uncommenting of minimal comments needs to be more robust. Currently it is easy
|
2.1.15
|
||||||
to get illegal syntax when uncommenting them.
|
- added pamconf support, thanks to Martin Kustermann
|
||||||
|
- added mason support, thanks to Indriði Einarsson
|
||||||
|
- added map support, thanks to Chris
|
||||||
|
- added bzr support, thanks to Stromnov
|
||||||
==============================================================================
|
- added group support, thanks to Krzysztof A. Adamski
|
||||||
8. Changelog *NERDComChangelog*
|
- change license to wtfpl
|
||||||
|
|
||||||
|
2.1.14
|
||||||
|
- added support for gitconfig, tar, nerdtree
|
||||||
|
- added support for dtrace, thanks to nicothakis for the post
|
||||||
2.1.13
|
2.1.13
|
||||||
- added support for rib, pyrex/cython, liquid, services, gitcommit,
|
- added support for rib, pyrex/cython, liquid, services, gitcommit,
|
||||||
vimperator, and slice. Thanks to spookypeanut, Greg Jandl, Christophe
|
vimperator, and slice. Thanks to spookypeanut, Greg Jandl, Christophe
|
||||||
@@ -895,7 +898,7 @@ to get illegal syntax when uncommenting them.
|
|||||||
nicothakis for posting the issue
|
nicothakis for posting the issue
|
||||||
|
|
||||||
2.1.8
|
2.1.8
|
||||||
- fixed a couple of bugs with the NERDSpaceDelims option, thx to
|
- fixed a couple of bugs with the NERDSpaceDelims option, thx to
|
||||||
David Miani and Jeremy Hinegardner
|
David Miani and Jeremy Hinegardner
|
||||||
- added dummy support for lhaskell, thx to pipp for posting the issue
|
- added dummy support for lhaskell, thx to pipp for posting the issue
|
||||||
- added an alternative set of delims for the plsql filetype, thx to Kuchma
|
- added an alternative set of delims for the plsql filetype, thx to Kuchma
|
||||||
@@ -905,7 +908,7 @@ to get illegal syntax when uncommenting them.
|
|||||||
- added support for asymptote, thx to Vladimir Lomov
|
- added support for asymptote, thx to Vladimir Lomov
|
||||||
- made NERDDefaultNesting enabled by default as this seems more intuitive,
|
- made NERDDefaultNesting enabled by default as this seems more intuitive,
|
||||||
thx to marco for the suggestion
|
thx to marco for the suggestion
|
||||||
|
|
||||||
|
|
||||||
2.1.7
|
2.1.7
|
||||||
- added support for haml, thx to Greb Weber
|
- added support for haml, thx to Greb Weber
|
||||||
@@ -984,7 +987,7 @@ to get illegal syntax when uncommenting them.
|
|||||||
- Made it so that the NERDShutUp option now only controls the "Pleeease
|
- Made it so that the NERDShutUp option now only controls the "Pleeease
|
||||||
email the delimiters..." requests. It no longer affects the general
|
email the delimiters..." requests. It no longer affects the general
|
||||||
output of the script.
|
output of the script.
|
||||||
- Simplified the names of the help tags.
|
- Simplified the names of the help tags.
|
||||||
|
|
||||||
2.0.5
|
2.0.5
|
||||||
- Added support for autoit, autohotkey and docbk filetypes (thanks to
|
- Added support for autoit, autohotkey and docbk filetypes (thanks to
|
||||||
@@ -1025,7 +1028,7 @@ to get illegal syntax when uncommenting them.
|
|||||||
|
|
||||||
2.0.0:
|
2.0.0:
|
||||||
- NOTE: renamed the script to NERD_commenter.vim. When you install this
|
- NOTE: renamed the script to NERD_commenter.vim. When you install this
|
||||||
version you must delete the old files: NERD_comments.vim and
|
version you must delete the old files: NERD_comments.vim and
|
||||||
NERD_comments.txt.
|
NERD_comments.txt.
|
||||||
- Reworked the mappings and main entry point function for the script to
|
- Reworked the mappings and main entry point function for the script to
|
||||||
avoid causing visual-bells and screen scrolling.
|
avoid causing visual-bells and screen scrolling.
|
||||||
@@ -1040,7 +1043,7 @@ to get illegal syntax when uncommenting them.
|
|||||||
ways)
|
ways)
|
||||||
- Some have been removed altogether, namely: NERD_create_h_filetype
|
- Some have been removed altogether, namely: NERD_create_h_filetype
|
||||||
(why was a commenting script creating a filetype?!),
|
(why was a commenting script creating a filetype?!),
|
||||||
NERD_left_align_regexp, NERD_right_align_regexp,
|
NERD_left_align_regexp, NERD_right_align_regexp,
|
||||||
|
|
||||||
- Removed all the NERD_use_alt_style_XXX_coms options and replaced them
|
- Removed all the NERD_use_alt_style_XXX_coms options and replaced them
|
||||||
with a better system. Now if a filetype has alternative delims, the
|
with a better system. Now if a filetype has alternative delims, the
|
||||||
@@ -1055,31 +1058,31 @@ to get illegal syntax when uncommenting them.
|
|||||||
filetypes.
|
filetypes.
|
||||||
- Added '#' comments as an alternative for the asm filetype
|
- Added '#' comments as an alternative for the asm filetype
|
||||||
|
|
||||||
Thanks to Markus Klinik and Anders for bug reports, and again to Anders
|
Thanks to Markus Klinik and Anders for bug reports, and again to Anders
|
||||||
for his patch. Thanks to John O'Shea and fREW for the filetype
|
for his patch. Thanks to John O'Shea and fREW for the filetype
|
||||||
information.
|
information.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
8. Credits *NERDComCredits*
|
7. Credits *NERDComCredits*
|
||||||
|
|
||||||
Thanks and respect to the following people:
|
Thanks and respect to the following people:
|
||||||
|
|
||||||
Thanks to Nick Brettell for his many ideas and criticisms. A bloody good
|
Thanks to Nick Brettell for his many ideas and criticisms. A bloody good
|
||||||
bastard.
|
bastard.
|
||||||
:normal :.-2s/good//
|
:normal :.-2s/good//
|
||||||
|
|
||||||
Thanks to Matthew Hawkins for his awesome refactoring!
|
Thanks to Matthew Hawkins for his awesome refactoring!
|
||||||
|
|
||||||
Thanks to the authors of the vimspell whose documentation
|
Thanks to the authors of the vimspell whose documentation
|
||||||
installation function I stole :)
|
installation function I stole :)
|
||||||
|
|
||||||
Thanks to Greg Searle for the idea of using place-holders for nested comments.
|
Thanks to Greg Searle for the idea of using place-holders for nested comments.
|
||||||
|
|
||||||
Thanks to Nguyen for the suggestions and pointing the h file highlighting bug!
|
Thanks to Nguyen for the suggestions and pointing the h file highlighting bug!
|
||||||
Also, thanks for the idea of doing sexy comments as well as his suggestions
|
Also, thanks for the idea of doing sexy comments as well as his suggestions
|
||||||
relating to it :P
|
relating to it :P
|
||||||
Thanks again to Nguyen for complaining about the NERD_comments menu mapping
|
Thanks again to Nguyen for complaining about the NERD_comments menu mapping
|
||||||
(<Alt>-c) interfering with another mapping of his... and thus the
|
(<Alt>-c) interfering with another mapping of his... and thus the
|
||||||
NERD_dont_create_menu_shortcut option was born :P
|
NERD_dont_create_menu_shortcut option was born :P
|
||||||
(it was then replaced with NERD_menu_mode in version 1.67 :)
|
(it was then replaced with NERD_menu_mode in version 1.67 :)
|
||||||
|
|
||||||
@@ -1133,7 +1136,7 @@ sexy comments. Sexy comments dont look so sexy when they are only half removed
|
|||||||
|
|
||||||
Thanks to Alexander "boesi" Bosecke for pointing out a bug that was stopping
|
Thanks to Alexander "boesi" Bosecke for pointing out a bug that was stopping
|
||||||
the NERD_space_delim_filetype_regexp option from working with left aligned
|
the NERD_space_delim_filetype_regexp option from working with left aligned
|
||||||
toggle comments. And for pointing out a bug when initialising VB comments.
|
toggle comments. And for pointing out a bug when initialising VB comments.
|
||||||
|
|
||||||
Thanks to Stefano Zacchiroli for suggesting the idea of "Minimal comments".
|
Thanks to Stefano Zacchiroli for suggesting the idea of "Minimal comments".
|
||||||
And for suggested improvements to minimal comments.
|
And for suggested improvements to minimal comments.
|
||||||
@@ -1226,7 +1229,7 @@ tinoucas gentoo-conf-d
|
|||||||
Greg Weber D, haml
|
Greg Weber D, haml
|
||||||
Bruce Sherrod velocity
|
Bruce Sherrod velocity
|
||||||
timberke cobol
|
timberke cobol
|
||||||
Aaron Schaefer factor
|
Aaron Schaefer factor
|
||||||
Laurent ARNOUD asterisk, mplayerconf
|
Laurent ARNOUD asterisk, mplayerconf
|
||||||
Kuchma Michael plsql
|
Kuchma Michael plsql
|
||||||
Brett Warneke spectre
|
Brett Warneke spectre
|
||||||
@@ -1235,7 +1238,7 @@ Renald Buter scala
|
|||||||
Vladimir Lomov asymptote
|
Vladimir Lomov asymptote
|
||||||
Marco mrxvtrc, aap
|
Marco mrxvtrc, aap
|
||||||
nicothakis SVNAnnotate, CVSAnnotate, SVKAnnotate,
|
nicothakis SVNAnnotate, CVSAnnotate, SVKAnnotate,
|
||||||
SVNdiff, gitAnnotate, gitdiff
|
SVNdiff, gitAnnotate, gitdiff, dtrace
|
||||||
Chen Xing Wikipedia
|
Chen Xing Wikipedia
|
||||||
Jacobo Diaz dakota, patran
|
Jacobo Diaz dakota, patran
|
||||||
Li Jin gentoo-env-d, gentoo-init-d,
|
Li Jin gentoo-env-d, gentoo-init-d,
|
||||||
@@ -1244,4 +1247,14 @@ SpookeyPeanut rib
|
|||||||
Greg Jandl pyrex/cython
|
Greg Jandl pyrex/cython
|
||||||
Christophe Benz services, gitcommit
|
Christophe Benz services, gitcommit
|
||||||
A Pontus vimperator
|
A Pontus vimperator
|
||||||
Stromnov slice
|
Stromnov slice, bzr
|
||||||
|
Martin Kustermann pamconf
|
||||||
|
Indriði Einarsson mason
|
||||||
|
Chris map
|
||||||
|
Krzysztof A. Adamski group
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
8. License *NERDComLicense*
|
||||||
|
|
||||||
|
The NERD commenter is released under the wtfpl.
|
||||||
|
See http://sam.zoy.org/wtfpl/COPYING.
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user