Try to line up tab header with columns.
[profile.git] / .vim / doc / NERD_commenter.txt
1 *NERD_commenter.txt*         Plugin for commenting code
2
3
4                         NERD COMMENTER REFERENCE MANUAL~
5
6
7
8
9
10 ==============================================================================
11 CONTENTS                                               *NERDCommenterContents*
12
13     1.Intro...................................|NERDCommenter|
14     2.Functionality provided..................|NERDComFunctionality|
15         2.1 Functionality Summary.............|NERDComFunctionalitySummary|
16         2.2 Functionality Details.............|NERDComFunctionalityDetails|
17             2.2.1 Comment map.................|NERDComComment|
18             2.2.2 Nested comment map..........|NERDComNestedComment|
19             2.2.3 Toggle comment map..........|NERDComToggleComment|
20             2.2.4 Minimal comment map.........|NERDComMinimalComment|
21             2.2.5 Invert comment map..........|NERDComInvertComment|
22             2.2.6 Sexy comment map............|NERDComSexyComment|
23             2.2.7 Yank comment map............|NERDComYankComment|
24             2.2.8 Comment to EOL map..........|NERDComEOLComment|
25             2.2.9 Append com to line map......|NERDComAppendComment|
26             2.2.10 Insert comment map.........|NERDComInsertComment|
27             2.2.11 Use alternate delims map...|NERDComAltDelim|
28             2.2.12 Comment aligned maps.......|NERDComAlignedComment|
29             2.2.13 Uncomment line map.........|NERDComUncommentLine|
30         2.3 Supported filetypes...............|NERDComFiletypes|
31         2.4 Sexy Comments.....................|NERDComSexyComments|
32         2.5 The NERDComment function..........|NERDComNERDComment|
33     3.Options.................................|NERDComOptions|
34         3.1 Options summary...................|NERDComOptionsSummary|
35         3.2 Options details...................|NERDComOptionsDetails|
36         3.3 Default delimiter Options.........|NERDComDefaultDelims|
37     4. Customising key mappings...............|NERDComMappings|
38     5. Issues with the script.................|NERDComIssues|
39         5.1 Delimiter detection heuristics....|NERDComHeuristics|
40         5.2 Nesting issues....................|NERDComNesting|
41     6.About..     ............................|NERDComAbout|
42     7.Changelog...............................|NERDComChangelog|
43     8.Credits.................................|NERDComCredits|
44     9.License.................................|NERDComLicense|
45
46 ==============================================================================
47 1. Intro                                                       *NERDCommenter*
48
49 The NERD commenter provides many different commenting operations and styles
50 which are invoked via key mappings and a menu. These operations are available
51 for most filetypes.
52
53 There are also options that allow to tweak the commenting engine to your
54 taste.
55
56 ==============================================================================
57 2. Functionality provided                               *NERDComFunctionality*
58
59 ------------------------------------------------------------------------------
60 2.1 Functionality summary                        *NERDComFunctionalitySummary*
61
62 The following key mappings are provided by default (there is also a menu
63 with items corresponding to all the mappings below):
64
65 [count],cc |NERDComComment|
66 Comment out the current line or text selected in visual mode.
67
68
69 [count],cn |NERDComNestedComment|
70 Same as ,cc but forces nesting.
71
72
73 [count],c<space> |NERDComToggleComment|
74 Toggles the comment state of the selected line(s). If the topmost selected
75 line is commented, all selected lines are uncommented and vice versa.
76
77
78 [count],cm |NERDComMinimalComment|
79 Comments the given lines using only one set of multipart delimiters.
80
81
82 [count],ci |NERDComInvertComment|
83 Toggles the comment state of the selected line(s) individually.
84
85
86 [count],cs |NERDComSexyComment|
87 Comments out the selected lines ``sexily''
88
89
90 [count],cy |NERDComYankComment|
91 Same as ,cc except that the commented line(s) are yanked first.
92
93
94 ,c$ |NERDComEOLComment|
95 Comments the current line from the cursor to the end of line.
96
97
98 ,cA |NERDComAppendComment|
99 Adds comment delimiters to the end of line and goes into insert mode between
100 them.
101
102
103 |NERDComInsertComment|
104 Adds comment delimiters at the current cursor position and inserts between.
105 Disabled by default.
106
107
108 ,ca |NERDComAltDelim|
109 Switches to the alternative set of delimiters.
110
111
112 [count],cl
113 [count],cb    |NERDComAlignedComment|
114 Same as |NERDComComment| except that the delimiters are aligned down the
115 left side (,cl) or both sides (,cb).
116
117
118 [count],cu |NERDComUncommentLine|
119 Uncomments the selected line(s).
120
121 ------------------------------------------------------------------------------
122 2.2 Functionality details                        *NERDComFunctionalityDetails*
123
124 ------------------------------------------------------------------------------
125 2.2.1 Comment map                                             *NERDComComment*
126
127 Default mapping: [count],cc
128 Mapped to: <plug>NERDCommenterComment
129 Applicable modes: normal visual visual-line visual-block.
130
131
132 Comments out the current line. If multiple lines are selected in visual-line
133 mode, they are all commented out.  If some text is selected in visual or
134 visual-block mode then the script will try to comment out the exact text that
135 is selected using multi-part delimiters if they are available.
136
137 If a [count] is given in normal mode, the mapping works as though that many
138 lines were selected in visual-line mode.
139
140 ------------------------------------------------------------------------------
141 2.2.2 Nested comment map                                *NERDComNestedComment*
142
143 Default mapping: [count],cn
144 Mapped to: <plug>NERDCommenterNest
145 Applicable modes: normal visual visual-line visual-block.
146
147 Performs nested commenting.  Works the same as ,cc except that if a line is
148 already commented then it will be commented again.
149
150 If |'NERDUsePlaceHolders'| is set then the previous comment delimiters will
151 be replaced by place-holder delimiters if needed.  Otherwise the nested
152 comment will only be added if the current commenting delimiters have no right
153 delimiter (to avoid syntax errors)
154
155 If a [count] is given in normal mode, the mapping works as though that many
156 lines were selected in visual-line mode.
157
158 Related options:
159 |'NERDDefaultNesting'|
160
161 ------------------------------------------------------------------------------
162 2.2.3 Toggle comment map                                *NERDComToggleComment*
163
164 Default mapping: [count],c<space>
165 Mapped to: <plug>NERDCommenterToggle
166 Applicable modes: normal visual-line.
167
168 Toggles commenting of the lines selected. The behaviour of this mapping
169 depends on whether the first line selected is commented or not.  If so, all
170 selected lines are uncommented and vice versa.
171
172 With this mapping, a line is only considered to be commented if it starts with
173 a left delimiter.
174
175 If a [count] is given in normal mode, the mapping works as though that many
176 lines were selected in visual-line mode.
177
178 ------------------------------------------------------------------------------
179 2.2.4 Minimal comment map                              *NERDComMinimalComment*
180
181 Default mapping: [count],cm
182 Mapped to: <plug>NERDCommenterMinimal
183 Applicable modes: normal visual-line.
184
185 Comments the selected lines using one set of multipart delimiters if possible.
186
187 For example: if you are programming in c and you select 5 lines and press ,cm
188 then a '/*' will be placed at the start of the top line and a '*/' will be
189 placed at the end of the last line.
190
191 Sets of multipart comment delimiters that are between the top and bottom
192 selected lines are replaced with place holders (see |'NERDLPlace'|) if
193 |'NERDUsePlaceHolders'| is set for the current filetype. If it is not, then
194 the comment will be aborted if place holders are required to prevent illegal
195 syntax.
196
197 If a [count] is given in normal mode, the mapping works as though that many
198 lines were selected in visual-line mode.
199
200 ------------------------------------------------------------------------------
201 2.2.5 Invert comment map                                *NERDComInvertComment*
202
203 Default mapping: ,ci
204 Mapped to: <plug>NERDCommenterInvert
205 Applicable modes: normal visual-line.
206
207 Inverts the commented state of each selected line. If the a selected line is
208 commented then it is uncommented and vice versa. Each line is examined and
209 commented/uncommented individually.
210
211 With this mapping, a line is only considered to be commented if it starts with
212 a left delimiter.
213
214 If a [count] is given in normal mode, the mapping works as though that many
215 lines were selected in visual-line mode.
216
217 ------------------------------------------------------------------------------
218 2.2.6 Sexy comment map                                    *NERDComSexyComment*
219
220 Default mapping: [count],cs
221 Mapped to: <plug>NERDCommenterSexy
222 Applicable modes: normal, visual-line.
223
224 Comments the selected line(s) ``sexily''... see |NERDComSexyComments| for
225 a description of what sexy comments are. Can only be done on filetypes for
226 which there is at least one set of multipart comment delimiters specified.
227
228 Sexy comments cannot be nested and lines inside a sexy comment cannot be
229 commented again.
230
231 If a [count] is given in normal mode, the mapping works as though that many
232 lines were selected in visual-line mode.
233
234 Related options:
235 |'NERDCompactSexyComs'|
236
237 ------------------------------------------------------------------------------
238 2.2.7 Yank comment map                                    *NERDComYankComment*
239
240 Default mapping: [count],cy
241 Mapped to: <plug>NERDCommenterYank
242 Applicable modes: normal visual visual-line visual-block.
243
244 Same as ,cc except that it yanks the line(s) that are commented first.
245
246 ------------------------------------------------------------------------------
247 2.2.8 Comment to EOL map                                   *NERDComEOLComment*
248
249 Default mapping: ,c$
250 Mapped to: <plug>NERDCommenterToEOL
251 Applicable modes: normal.
252
253 Comments the current line from the current cursor position up to the end of
254 the line.
255
256 ------------------------------------------------------------------------------
257 2.2.9 Append com to line map                            *NERDComAppendComment*
258
259 Default mapping: ,cA
260 Mapped to: <plug>NERDCommenterAppend
261 Applicable modes: normal.
262
263 Appends comment delimiters to the end of the current line and goes
264 to insert mode between the new delimiters.
265
266 ------------------------------------------------------------------------------
267 2.2.10 Insert comment map                               *NERDComInsertComment*
268
269 Default mapping: disabled by default.
270 Map it to: <plug>NERDCommenterInInsert
271 Applicable modes: insert.
272
273 Adds comment delimiters at the current cursor position and inserts
274 between them.
275
276 NOTE: prior to version 2.1.17 this was mapped to ctrl-c. To restore this
277 mapping add >
278     let NERDComInsertMap='<c-c>'
279 <
280 to your vimrc.
281
282 ------------------------------------------------------------------------------
283 2.2.11 Use alternate delims map                              *NERDComAltDelim*
284
285 Default mapping: ,ca
286 Mapped to: <plug>NERDCommenterAltDelims
287 Applicable modes: normal.
288
289 Changes to the alternative commenting style if one is available. For example,
290 if the user is editing a c++ file using // comments and they hit ,ca
291 then they will be switched over to /**/ comments.
292
293 See also |NERDComDefaultDelims|
294
295 ------------------------------------------------------------------------------
296 2.2.12 Comment aligned maps                            *NERDComAlignedComment*
297
298 Default mappings: [count],cl   [count],cb
299 Mapped to: <plug>NERDCommenterAlignLeft
300            <plug>NERDCommenterAlignBoth
301 Applicable modes: normal visual-line.
302
303 Same as ,cc except that the comment delimiters are aligned on the left side or
304 both sides respectively. These comments are always nested if the line(s) are
305 already commented.
306
307 If a [count] is given in normal mode, the mapping works as though that many
308 lines were selected in visual-line mode.
309
310 ------------------------------------------------------------------------------
311 2.2.13 Uncomment line map                               *NERDComUncommentLine*
312
313 Default mapping: [count],cu
314 Mapped to: <plug>NERDCommenterUncomment
315 Applicable modes: normal visual visual-line visual-block.
316
317 Uncomments the current line. If multiple lines are selected in
318 visual mode then they are all uncommented.
319
320 When uncommenting, if the line contains multiple sets of delimiters then the
321 ``outtermost'' pair of delimiters will be removed.
322
323 The script uses a set of heurisics to distinguish ``real'' delimiters from
324 ``fake'' ones when uncommenting. See |NERDComIssues| for details.
325
326 If a [count] is given in normal mode, the mapping works as though that many
327 lines were selected in visual-line mode.
328
329 Related  options:
330 |'NERDRemoveAltComs'|
331 |'NERDRemoveExtraSpaces'|
332
333 ------------------------------------------------------------------------------
334 2.3 Supported filetypes                                     *NERDComFiletypes*
335
336 Filetypes that can be commented by this plugin:
337 abaqus abc acedb ada ahdl amiga aml ampl ant apache apachestyle asm68k asm asn
338 aspvbs atlas autohotkey autoit automake ave awk basic b bc bdf bib bindzone
339 bst btm caos catalog c cfg cg ch changelog cl clean clipper cmake conf config
340 context cpp crontab cs csc csp css cterm cupl csv cvs dcl debchangelog
341 debcontrol debsources def diff django docbk dns dosbatch dosini dot dracula
342 dsl dtd dtml dylan ecd eiffel elf elmfilt erlang eruby eterm expect exports
343 fetchmail fgl focexec form fortran foxpro fstab fvwm fx gdb gdmo geek
344 gentoo-package-keywords' gentoo-package-mask' gentoo-package-use' gnuplot
345 gtkrc haskell hb h help hercules hog html htmldjango htmlos ia64 icon idlang
346 idl indent inform inittab ishd iss ist jam java javascript jess jgraph
347 jproperties jproperties jsp kconfig kix kscript lace lex lftp lifelines lilo
348 lisp lite lotos lout lprolog lscript lss lua lynx m4 mail make maple masm
349 master matlab mel mf mib mma model moduala.  modula2 modula3 monk mush muttrc
350 named nasm nastran natural ncf netdict netrw nqc nroff nsis objc ocaml occam
351 omlet omnimark openroad opl ora otl ox pascal passwd pcap pccts perl pfmain
352 php phtml pic pike pilrc pine plaintex plm plsql po postscr pov povini ppd
353 ppwiz procmail progress prolog psf ptcap python python qf radiance ratpoison r
354 rc readline rebol registry remind rexx robots rpl rtf ruby sa samba sas sass
355 sather scheme scilab screen scsh sdl sed selectbuf sgml sgmldecl sgmllnx sh
356 sicad simula sinda skill slang sl slrnrc sm smarty smil smith sml snnsnet
357 snnspat snnsres snobol4 spec specman spice sql sqlforms sqlj sqr squid st stp
358 strace svn systemverilog tads taglist tags tak tasm tcl terminfo tex text
359 plaintex texinfo texmf tf tidy tli trasys tsalt tsscl tssgm uc uil vb verilog
360 verilog_systemverilog vgrindefs vhdl vim viminfo virata vo_base vrml vsejcl
361 webmacro wget winbatch wml wvdial xdefaults xf86conf xhtml xkb xmath xml
362 xmodmap xpm2 xpm xslt yacc yaml z8a
363
364 If a language is not in the list of hardcoded supported filetypes then the
365 &commentstring vim option is used.
366
367 ------------------------------------------------------------------------------
368 2.4 Sexy Comments                                        *NERDComSexyComments*
369 These are comments that use one set of multipart comment delimiters as well as
370 one other marker symbol. For example: >
371     /*
372      * This is a c style sexy comment
373      * So there!
374      */
375
376     /* This is a c style sexy comment
377      * So there!
378      * But this one is ``compact'' style */
379 <
380 Here the multipart delimiters are /* and */ and the marker is *.
381
382 ------------------------------------------------------------------------------
383 2.5 The NERDComment function                             *NERDComNERDComment*
384
385 All of the NERD commenter mappings and menu items invoke a single function
386 which delegates the commenting work to other functions. This function is
387 public and has the prototype: >
388     function! NERDComment(isVisual, type)
389 <
390 The arguments to this function are simple:
391     - isVisual: if you wish to do any kind of visual comment then set this to
392       1 and the function will use the '< and '> marks to find the comment
393       boundries. If set to 0 then the function will operate on the current
394       line.
395     - type: is used to specify what type of commenting operation is to be
396       performed, and it can be one of the following: "sexy", "invert",
397       "minimal", "toggle", "alignLeft", "alignBoth", "norm", "nested",
398       "toEOL", "append", "insert", "uncomment", "yank"
399
400 For example, if you typed >
401     :call NERDComment(1, 'sexy')
402 <
403 then the script would do a sexy comment on the last visual selection.
404
405
406 ==============================================================================
407 3. Options                                                    *NERDComOptions*
408
409 ------------------------------------------------------------------------------
410 3.1 Options summary                                    *NERDComOptionsSummary*
411
412 |'loaded_nerd_comments'|              Turns off the script.
413 |'NERDAllowAnyVisualDelims'|          Allows multipart alternative delims to
414                                       be used when commenting in
415                                       visual/visual-block mode.
416 |'NERDBlockComIgnoreEmpty'|           Forces right delims to be placed when
417                                       doing visual-block comments.
418 |'NERDCommentWholeLinesInVMode'|      Changes behaviour of visual comments.
419 |'NERDCreateDefaultMappings'|         Turn the default mappings on/off.
420 |'NERDDefaultNesting'|                Tells the script to use nested comments
421                                       by default.
422 |'NERDMenuMode'|                      Specifies how the NERD commenter menu
423                                       will appear (if at all).
424 |'NERDLPlace'|                        Specifies what to use as the left
425                                       delimiter placeholder when nesting
426                                       comments.
427 |'NERDUsePlaceHolders'|               Specifies which filetypes may use
428                                       placeholders when nesting comments.
429 |'NERDRemoveAltComs'|                 Tells the script whether to remove
430                                       alternative comment delimiters when
431                                       uncommenting.
432 |'NERDRemoveExtraSpaces'|             Tells the script to always remove the
433                                       extra spaces when uncommenting
434                                       (regardless of whether NERDSpaceDelims
435                                       is set)
436 |'NERDRPlace'|                        Specifies what to use as the right
437                                       delimiter placeholder when nesting
438                                       comments.
439 |'NERDSpaceDelims'|                   Specifies whether to add extra spaces
440                                       around delimiters when commenting, and
441                                       whether to remove them when
442                                       uncommenting.
443 |'NERDCompactSexyComs'|               Specifies whether to use the compact
444                                       style sexy comments.
445
446 ------------------------------------------------------------------------------
447 3.3 Options details                                    *NERDComOptionsDetails*
448
449 To enable any of the below options you should put the given line in your
450 ~/.vimrc
451
452                                                        *'loaded_nerd_comments'*
453 If this script is driving you insane you can turn it off by setting this
454 option >
455     let loaded_nerd_comments=1
456 <
457 ------------------------------------------------------------------------------
458                                                     *'NERDAllowAnyVisualDelims'*
459 Values: 0 or 1.
460 Default: 1.
461
462 If set to 1 then, when doing a visual or visual-block comment (but not a
463 visual-line comment), the script will choose the right delimiters to use for
464 the comment. This means either using the current delimiters if they are
465 multipart or using the alternative delimiters if THEY are multipart.  For
466 example if we are editing the following java code: >
467     float foo = 1221;
468     float bar = 324;
469     System.out.println(foo * bar);
470 <
471 If we are using // comments and select the "foo" and "bar" in visual-block
472 mode, as shown left below (where '|'s are used to represent the visual-block
473 boundary), and comment it then the script will use the alternative delims as
474 shown on the right: >
475
476     float |foo| = 1221;                   float /*foo*/ = 1221;
477     float |bar| = 324;                    float /*bar*/ = 324;
478     System.out.println(foo * bar);        System.out.println(foo * bar);
479 <
480 ------------------------------------------------------------------------------
481                                                      *'NERDBlockComIgnoreEmpty'*
482 Values: 0 or 1.
483 Default: 1.
484
485 This option  affects visual-block mode commenting. If this option is turned
486 on, lines that begin outside the right boundary of the selection block will be
487 ignored.
488
489 For example, if you are commenting this chunk of c code in visual-block mode
490 (where the '|'s are used to represent the visual-block boundary) >
491     #include <sys/types.h>
492     #include <unistd.h>
493     #include <stdio.h>
494    |int| main(){
495    |   | printf("SUCK THIS\n");
496    |   | while(1){
497    |   |     fork();
498    |   | }
499    |}  |
500 <
501 If NERDBlockComIgnoreEmpty=0 then this code will become: >
502     #include <sys/types.h>
503     #include <unistd.h>
504     #include <stdio.h>
505     /*int*/ main(){
506     /*   */ printf("SUCK THIS\n");
507     /*   */ while(1){
508     /*   */     fork();
509     /*   */ }
510     /*}  */
511 <
512 Otherwise, the code block would become: >
513     #include <sys/types.h>
514     #include <unistd.h>
515     #include <stdio.h>
516     /*int*/ main(){
517     printf("SUCK THIS\n");
518     while(1){
519         fork();
520     }
521     /*}  */
522 <
523 ------------------------------------------------------------------------------
524                                                 *'NERDCommentWholeLinesInVMode'*
525 Values: 0, 1 or 2.
526 Default: 0.
527
528 By default the script tries to comment out exactly what is selected in visual
529 mode (v). For example if you select and comment the following c code (using |
530 to represent the visual boundary): >
531     in|t foo = 3;
532     int bar =| 9;
533     int baz = foo + bar;
534 <
535 This will result in: >
536     in/*t foo = 3;*/
537     /*int bar =*/ 9;
538     int baz = foo + bar;
539 <
540 But some people prefer it if the whole lines are commented like: >
541     /*int foo = 3;*/
542     /*int bar = 9;*/
543     int baz = foo + bar;
544 <
545 If you prefer the second option then stick this line in your vimrc: >
546     let NERDCommentWholeLinesInVMode=1
547 <
548
549 If the filetype you are editing only has no multipart delimiters (for example
550 a shell script) and you hadnt set this option then the above would become >
551     in#t foo = 3;
552     #int bar = 9;
553 <
554 (where # is the comment delimiter) as this is the closest the script can
555 come to commenting out exactly what was selected. If you prefer for whole
556 lines to be commented out when there is no multipart delimiters but the EXACT
557 text that was selected to be commented out if there IS multipart delimiters
558 then stick the following line in your vimrc: >
559     let NERDCommentWholeLinesInVMode=2
560 <
561
562 Note that this option does not affect the behaviour of commenting in
563 |visual-block| mode.
564
565 ------------------------------------------------------------------------------
566                                                 *'NERDCreateDefaultMappings'*
567 Values: 0 or 1.
568 Default: 1.
569
570 If set to 0, none of the default mappings will be created.
571
572 See also |NERDComMappings|.
573
574 ------------------------------------------------------------------------------
575                                                            *'NERDRemoveAltComs'*
576 Values: 0 or 1.
577 Default: 1.
578
579 When uncommenting a line (for a filetype with an alternative commenting style)
580 this option tells the script whether to look for, and remove, comment
581 delimiters of the alternative style.
582
583 For example, if you are editing a c++ file using // style comments and you go
584 ,cu on this line: >
585     /* This is a c++ comment baby! */
586 <
587 It will not be uncommented if the NERDRemoveAltComs is set to 0.
588
589 ------------------------------------------------------------------------------
590                                                        *'NERDRemoveExtraSpaces'*
591 Values: 0 or 1.
592 Default: 1.
593
594 By default, the NERD commenter will remove spaces around comment delimiters if
595 either:
596 1. |'NERDSpaceDelims'| is set to 1.
597 2. NERDRemoveExtraSpaces is set to 1.
598
599 This means that if we have the following lines in a c code file: >
600     /* int foo = 5; */
601     /* int bar = 10; */
602     int baz = foo + bar
603 <
604 If either of the above conditions hold then if these lines are uncommented
605 they will become: >
606     int foo = 5;
607     int bar = 10;
608     int baz = foo + bar
609 <
610 Otherwise they would become: >
611      int foo = 5;
612      int bar = 10;
613     int baz = foo + bar
614 <
615 If you want the spaces to be removed only if |'NERDSpaceDelims'| is set then
616 set NERDRemoveExtraSpaces to 0.
617
618 ------------------------------------------------------------------------------
619                                                                   *'NERDLPlace'*
620                                                                   *'NERDRPlace'*
621 Values: arbitrary string.
622 Default:
623     NERDLPlace: "[>"
624     NERDRPlace: "<]"
625
626 These options are used to control the strings used as place-holder delimiters.
627 Place holder delimiters are used when performing nested commenting when the
628 filetype supports commenting styles with both left and right delimiters.
629 To set these options use lines like: >
630     let NERDLPlace="FOO"
631     let NERDRPlace="BAR"
632 <
633 Following the above example, if we have line of c code: >
634     /* int horse */
635 <
636 and we comment it with ,cn it will be changed to: >
637     /*FOO int horse BAR*/
638 <
639 When we uncomment this line it will go back to what it was.
640
641 ------------------------------------------------------------------------------
642                                                                 *'NERDMenuMode'*
643 Values: 0, 1, 2, 3.
644 Default: 3
645
646 This option can take 4 values:
647     "0": Turns the menu off.
648     "1": Turns the 'comment' menu on with no menu shortcut.
649     "2": Turns the 'comment 'menu on with <alt>-c as the shortcut.
650     "3": Turns the 'Plugin -> comment' menu on with <alt>-c as the shortcut.
651
652 ------------------------------------------------------------------------------
653                                                          *'NERDUsePlaceHolders'*
654 Values: 0 or 1.
655 Default 1.
656
657 This option is used to specify whether place-holder delimiters should be used
658 when creating a nested comment.
659
660 ------------------------------------------------------------------------------
661                                                              *'NERDSpaceDelims'*
662 Values: 0 or 1.
663 Default 0.
664
665 Some people prefer a space after the left delimiter and before the right
666 delimiter like this: >
667     /* int foo=2; */
668 <
669 as opposed to this: >
670     /*int foo=2;*/
671 <
672 If you want spaces to be added then set NERDSpaceDelims to 1 in your vimrc.
673
674 See also |'NERDRemoveExtraSpaces'|.
675
676 ------------------------------------------------------------------------------
677                                                          *'NERDCompactSexyComs'*
678 Values: 0 or 1.
679 Default 0.
680
681 Some people may want their sexy comments to be like this: >
682     /* Hi There!
683      * This is a sexy comment
684      * in c */
685 <
686 As opposed to like this: >
687     /*
688      * Hi There!
689      * This is a sexy comment
690      * in c
691      */
692 <
693 If this option is set to 1 then the top style will be used.
694
695 ------------------------------------------------------------------------------
696                                                           *'NERDDefaultNesting'*
697 Values: 0 or 1.
698 Default 1.
699
700 When this option is set to 1, comments are nested automatically. That is, if
701 you hit ,cc on a line that is already commented it will be commented again
702
703 ------------------------------------------------------------------------------
704 3.3 Default delimiter customisation                     *NERDComDefaultDelims*
705
706 If you want the NERD commenter to use the alternative delimiters for a
707 specific filetype by default then put a line of this form into your vimrc: >
708     let NERD_<filetype>_alt_style=1
709 <
710 Example: java uses // style comments by default, but you want it to default to
711 /* */ style comments instead. You would put this line in your vimrc: >
712     let NERD_java_alt_style=1
713 <
714
715 See |NERDComAltDelim| for switching commenting styles at runtime.
716
717 ==============================================================================
718 4. Key mapping customisation                                *NERDComMappings*
719
720 To change a mapping just map another key combo to the internal <plug> mapping.
721 For example, to remap the |NERDComComment| mapping to ",omg" you would put
722 this line in your vimrc: >
723     map ,omg <plug>NERDCommenterComment
724 <
725 This will stop the corresponding default mappings from being created.
726
727 See the help for the mapping in question to see which <plug> mapping to
728 map to.
729
730 See also |'NERDCreateDefaultMappings'|.
731
732 ==============================================================================
733 5. Issues with the script                                      *NERDComIssues*
734
735
736 ------------------------------------------------------------------------------
737 5.1 Delimiter detection heuristics                         *NERDComHeuristics*
738
739 Heuristics are used to distinguish the real comment delimiters
740
741 Because we have comment mappings that place delimiters in the middle of lines,
742 removing comment delimiters is a bit tricky. This is because if comment
743 delimiters appear in a line doesnt mean they really ARE delimiters. For
744 example, Java uses // comments but the line >
745     System.out.println("//");
746 <
747 clearly contains no real comment delimiters.
748
749 To distinguish between ``real'' comment delimiters and ``fake'' ones we use a
750 set of heuristics. For example, one such heuristic states that any comment
751 delimiter that has an odd number of non-escaped " characters both preceding
752 and following it on the line is not a comment because it is probably part of a
753 string. These heuristics, while usually pretty accurate, will not work for all
754 cases.
755
756 ------------------------------------------------------------------------------
757 5.2 Nesting issues                                            *NERDComNesting*
758
759 If we have some line of code like this: >
760     /*int foo */ = /*5 + 9;*/
761 <
762 This will not be uncommented legally. The NERD commenter will remove the
763 "outter most" delimiters so the line will become: >
764     int foo */ = /*5 + 9;
765 <
766 which almost certainly will not be what you want. Nested sets of comments will
767 uncomment fine though. Eg: >
768     /*int/* foo =*/ 5 + 9;*/
769 <
770 will become: >
771     int/* foo =*/ 5 + 9;
772 <
773 (Note that in the above examples I have deliberately not used place holders
774 for simplicity)
775
776 ==============================================================================
777 6. About                                                        *NERDComAbout*
778
779 The author of the NERD commenter is Martyzillatron --- the half robot, half
780 dinosaur bastard son of Megatron and Godzilla. He enjoys destroying
781 metropolises and eating tourist busses.
782
783 Drop him a line at martin_grenfell at msn.com. He would love to hear from you.
784 its a lonely life being the worlds premier terror machine. How would you feel
785 if your face looked like a toaster and a t-rex put together? :(
786
787 The latest stable versions can be found at
788     http://www.vim.org/scripts/script.php?script_id=1218
789
790 The latest dev versions are on github
791     http://github.com/scrooloose/nerdcommenter
792
793 ==============================================================================
794 8. Changelog                                                *NERDComChangelog*
795
796 2.2.2
797     - remove the NERDShutup option and the message is suppresses, this makes
798       the plugin silently rely on &commentstring for unknown filetypes.
799     - add support for dhcpd, limits, ntp, resolv, rgb, sysctl, udevconf and
800       udevrules. Thanks to Thilo Six.
801     - match filetypes case insensitively
802     - add support for mp (metapost), thanks to Andrey Skvortsov.
803     - add support for htmlcheetah, thanks to Simon Hengel.
804     - add support for javacc, thanks to Matt Tolton.
805     - make <%# %> the default delims for eruby, thanks to tpope.
806     - add support for javascript.jquery, thanks to Ivan Devat.
807     - add support for cucumber and pdf. Fix sass and railslog delims,
808       thanks to tpope
809
810 2.2.1
811     - add support for newlisp and clojure, thanks to Matthew Lee Hinman.
812     - fix automake comments, thanks to Elias Pipping
813     - make haml comments default to -# with / as the alternative delimiter,
814       thanks to tpope
815     - add support for actionscript and processing thanks to Edwin Benavides
816     - add support for ps1 (powershell), thanks to Jason Mills
817     - add support for hostsaccess, thanks to Thomas Rowe
818     - add support for CVScommit
819     - add support for asciidoc, git and gitrebase. Thanks to Simon Ruderich.
820     - use # for gitcommit comments, thanks to Simon Ruderich.
821     - add support for mako and genshi, thanks to Keitheis.
822     - add support for conkyrc, thanks to David
823     - add support for SVNannotate, thanks to Miguel Jaque Barbero.
824     - add support for sieve, thanks to Stefan Walk
825     - add support for objj, thanks to Adam Thorsen.
826
827 2.2.0
828     - rewrote the mappings system to be more "standard".
829       - removed all the mapping options. Now, mappings to <plug> mappings are
830         used
831       - see :help NERDComMappings, and :help NERDCreateDefaultMappings for
832         more info
833     - remove "prepend comments" and "right aligned comments".
834     - add support for applescript, calbire, man, SVNcommit, potwiki, txt2tags and SVNinfo.
835       Thanks to nicothakis, timberke, sgronblo, mntnoe, Bernhard Grotz, John
836       O'Shea, François and Giacomo Mariani respectively.
837     - bugfix for haskell delimiters. Thanks to mntnoe.
838 2.1.18
839     - add support for llvm. Thanks to nicothakis.
840     - add support for xquery. Thanks to Phillip Kovalev.
841 2.1.17
842     - fixed haskell delimiters (hackily). Thanks to Elias Pipping.
843     - add support for mailcap. Thanks to Pascal Brueckner.
844     - add support for stata. Thanks to Jerónimo Carballo.
845     - applied a patch from ewfalor to fix an error in the help file with the
846       NERDMapleader doc
847     - disable the insert mode ctrl-c mapping by default, see :help
848       NERDComInsertComment if you wish to restore it
849
850 ==============================================================================
851 8. Credits                                                    *NERDComCredits*
852
853 Thanks to the follow people for suggestions and patches:
854
855 Nick Brettell
856 Matthew Hawkins
857 Mathieu Clabaut
858 Greg Searle
859 Nguyen
860 Litchi
861 Jorge Scandaliaris
862 Shufeng Zheng
863 Martin Stubenschrott
864 Markus Erlmann
865 Brent Rice
866 Richard Willis
867 Igor Prischepoff
868 Harry
869 David Bourgeois
870 Eike Von Seggern
871 Torsten Blix
872 Alexander Bosecke
873 Stefano Zacchiroli
874 Norick Chen
875 Joseph Barker
876 Gary Church
877 Tim Carey-Smith
878 Markus Klinik
879 Anders
880 Seth Mason
881 James Hales
882 Heptite
883 Cheng Fang
884 Yongwei Wu
885 David Miani
886 Jeremy Hinegardner
887 Marco
888 Ingo Karkat
889 Zhang Shuhan
890 tpope
891 Ben Schmidt
892 David Fishburn
893 Erik Falor
894 JaGoTerr
895 Elias Pipping
896 mntnoe
897 Mark S.
898
899
900 Thanks to the following people for sending me new filetypes to support:
901
902 The hackers                         The filetypes~
903 Sam R                               verilog
904 Jonathan                            Derque context, plaintext and mail
905 Vigil                               fetchmail
906 Michael Brunner                     kconfig
907 Antono Vasiljev                     netdict
908 Melissa Reid                        omlet
909 Ilia N Ternovich                    quickfix
910 John O'Shea                         RTF, SVNcommitlog and vcscommit, SVNCommit
911 Anders                              occam
912 Mark Woodward                       csv
913 fREW                                gentoo-package-mask,
914                                     gentoo-package-keywords,
915                                     gentoo-package-use, and vo_base
916 Alexey                              verilog_systemverilog, systemverilog
917 Lizendir                            fstab
918 Michael Böhler                      autoit, autohotkey and docbk
919 Aaron Small                         cmake
920 Ramiro                              htmldjango and django
921 Stefano Zacchiroli                  debcontrol, debchangelog, mkd
922 Alex Tarkovsky                      ebuild and eclass
923 Jorge Rodrigues                     gams
924 Rainer Müller                       Objective C
925 Jason Mills                         Groovy, ps1
926 Normandie Azucena                   vera
927 Florian Apolloner                   ldif
928 David Fishburn                      lookupfile
929 Niels Aan de Brugh                  rst
930 Don Hatlestad                       ahk
931 Christophe Benz                     Desktop and xsd
932 Eyolf Østrem                        lilypond, bbx and lytex
933 Ingo Karkat                         dosbatch
934 Nicolas Weber                       markdown, objcpp
935 tinoucas                            gentoo-conf-d
936 Greg Weber                          D, haml
937 Bruce Sherrod                       velocity
938 timberke                            cobol, calibre
939 Aaron Schaefer                      factor
940 Mr X                                asterisk, mplayerconf
941 Kuchma Michael                      plsql
942 Brett Warneke                       spectre
943 Pipp                                lhaskell
944 Renald Buter                        scala
945 Vladimir Lomov                      asymptote
946 Marco                               mrxvtrc, aap
947 nicothakis                          SVNAnnotate, CVSAnnotate, SVKAnnotate,
948                                     SVNdiff, gitAnnotate, gitdiff, dtrace
949                                     llvm, applescript
950 Chen Xing                           Wikipedia
951 Jacobo Diaz                         dakota, patran
952 Li Jin                              gentoo-env-d, gentoo-init-d,
953                                     gentoo-make-conf, grub, modconf, sudoers
954 SpookeyPeanut                       rib
955 Greg Jandl                          pyrex/cython
956 Christophe Benz                     services, gitcommit
957 A Pontus                            vimperator
958 Stromnov                            slice, bzr
959 Martin Kustermann                   pamconf
960 Indriði Einarsson                   mason
961 Chris                               map
962 Krzysztof A. Adamski                group
963 Pascal Brueckner                    mailcap
964 Jerónimo Carballo                   stata
965 Phillip Kovalev                     xquery
966 Bernhard Grotz                      potwiki
967 sgronblo                            man
968 François                            txt2tags
969 Giacomo Mariani                     SVNinfo
970 Matthew Lee Hinman                  newlisp, clojure
971 Elias Pipping                       automake
972 Edwin Benavides                     actionscript, processing
973 Thomas Rowe                         hostsaccess
974 Simon Ruderich                      asciidoc, git, gitcommit, gitrebase
975 Keitheis                            mako, genshi
976 David                               conkyrc
977 Miguel Jaque Barbero                SVNannotate
978 Stefan Walk                         sieve
979 Adam Thorsen                        objj
980 Thilo Six                           dhcpd, limits, ntp, resolv, rgb, sysctl,
981                                     udevconf, udevrules
982 Andrey Skvortsov                    mp
983 Simon Hengel                        htmlcheetah
984 Matt Tolton                         javacc
985 Ivan Devat                          javascript.jquery
986 tpope                               cucumber,pdf
987 ==============================================================================
988 9. License                                                    *NERDComLicense*
989
990 The NERD commenter is released under the wtfpl.
991 See http://sam.zoy.org/wtfpl/COPYING.