Skip to content

Commit

Permalink
update the doc
Browse files Browse the repository at this point in the history
Add a note about installation. Remove the 'supported filetypes' section.
  • Loading branch information
marty committed Aug 2, 2010
1 parent 02c726c commit 5c9359d
Showing 1 changed file with 80 additions and 93 deletions.
173 changes: 80 additions & 93 deletions doc/NERD_commenter.txt
Expand Up @@ -11,37 +11,37 @@
CONTENTS *NERDCommenterContents* CONTENTS *NERDCommenterContents*


1.Intro...................................|NERDCommenter| 1.Intro...................................|NERDCommenter|
2.Functionality provided..................|NERDComFunctionality| 2.Installation............................|NERDComInstallation|
2.1 Functionality Summary.............|NERDComFunctionalitySummary| 3.Functionality provided..................|NERDComFunctionality|
2.2 Functionality Details.............|NERDComFunctionalityDetails| 3.1 Functionality Summary.............|NERDComFunctionalitySummary|
2.2.1 Comment map.................|NERDComComment| 3.2 Functionality Details.............|NERDComFunctionalityDetails|
2.2.2 Nested comment map..........|NERDComNestedComment| 3.2.1 Comment map.................|NERDComComment|
2.2.3 Toggle comment map..........|NERDComToggleComment| 3.2.2 Nested comment map..........|NERDComNestedComment|
2.2.4 Minimal comment map.........|NERDComMinimalComment| 3.2.3 Toggle comment map..........|NERDComToggleComment|
2.2.5 Invert comment map..........|NERDComInvertComment| 3.2.4 Minimal comment map.........|NERDComMinimalComment|
2.2.6 Sexy comment map............|NERDComSexyComment| 3.2.5 Invert comment map..........|NERDComInvertComment|
2.2.7 Yank comment map............|NERDComYankComment| 3.2.6 Sexy comment map............|NERDComSexyComment|
2.2.8 Comment to EOL map..........|NERDComEOLComment| 3.2.7 Yank comment map............|NERDComYankComment|
2.2.9 Append com to line map......|NERDComAppendComment| 3.2.8 Comment to EOL map..........|NERDComEOLComment|
2.2.10 Insert comment map.........|NERDComInsertComment| 3.2.9 Append com to line map......|NERDComAppendComment|
2.2.11 Use alternate delims map...|NERDComAltDelim| 3.2.10 Insert comment map.........|NERDComInsertComment|
2.2.12 Comment aligned maps.......|NERDComAlignedComment| 3.2.11 Use alternate delims map...|NERDComAltDelim|
2.2.13 Uncomment line map.........|NERDComUncommentLine| 3.2.12 Comment aligned maps.......|NERDComAlignedComment|
2.3 Supported filetypes...............|NERDComFiletypes| 3.2.13 Uncomment line map.........|NERDComUncommentLine|
2.4 Sexy Comments.....................|NERDComSexyComments| 3.4 Sexy Comments.....................|NERDComSexyComments|
2.5 The NERDComment function..........|NERDComNERDComment| 3.5 The NERDComment function..........|NERDComNERDComment|
3.Options.................................|NERDComOptions| 4.Options.................................|NERDComOptions|
3.1 Options summary...................|NERDComOptionsSummary| 4.1 Options summary...................|NERDComOptionsSummary|
3.2 Options details...................|NERDComOptionsDetails| 4.2 Options details...................|NERDComOptionsDetails|
3.3 Default delimiter Options.........|NERDComDefaultDelims| 4.3 Default delimiter Options.........|NERDComDefaultDelims|
4. Customising key mappings...............|NERDComMappings| 5. Customising key mappings...............|NERDComMappings|
5. Issues with the script.................|NERDComIssues| 6. Issues with the script.................|NERDComIssues|
5.1 Delimiter detection heuristics....|NERDComHeuristics| 6.1 Delimiter detection heuristics....|NERDComHeuristics|
5.2 Nesting issues....................|NERDComNesting| 6.2 Nesting issues....................|NERDComNesting|
6.About.. ............................|NERDComAbout| 7.About.. ............................|NERDComAbout|
7.Changelog...............................|NERDComChangelog| 8.Changelog...............................|NERDComChangelog|
8.Credits.................................|NERDComCredits| 9.Credits.................................|NERDComCredits|
9.License.................................|NERDComLicense| 10.License................................|NERDComLicense|


============================================================================== ==============================================================================
1. Intro *NERDCommenter* 1. Intro *NERDCommenter*
Expand All @@ -54,10 +54,31 @@ There are also options that allow to tweak the commenting engine to your
taste. taste.


============================================================================== ==============================================================================
2. Functionality provided *NERDComFunctionality* 2. Installation *NERDComInstallation*

The NERD Commenter requires Vim 7 or higher.

Extract the plugin files in your ~/.vim (*nix) or ~/vimfiles (Windows). You
should have 2 files: >
plugin/NERD_commenter.vim
doc/NERD_commenter.txt
<
Next, to finish installing the help file run: >
:helptags ~/.vim/doc
<
See |add-local-help| for more details.

Make sure that you have filetype plugins enabled, as the script makes use of
|'commentstring'| where possible (which is usually set in a filetype plugin).
See |filetype-plugin-on| for details, but basically, stick this in your vimrc >
filetype plugin on
<

==============================================================================
3. Functionality provided *NERDComFunctionality*


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.1 Functionality summary *NERDComFunctionalitySummary* 3.1 Functionality summary *NERDComFunctionalitySummary*


The following key mappings are provided by default (there is also a menu The following key mappings are provided by default (there is also a menu
with items corresponding to all the mappings below): with items corresponding to all the mappings below):
Expand Down Expand Up @@ -119,10 +140,10 @@ left side (<leader>cl) or both sides (<leader>cb).
Uncomments the selected line(s). Uncomments the selected line(s).


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.2 Functionality details *NERDComFunctionalityDetails* 3.2 Functionality details *NERDComFunctionalityDetails*


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.2.1 Comment map *NERDComComment* 3.2.1 Comment map *NERDComComment*


Default mapping: [count]<leader>cc Default mapping: [count]<leader>cc
Mapped to: <plug>NERDCommenterComment Mapped to: <plug>NERDCommenterComment
Expand All @@ -138,7 +159,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.2 Nested comment map *NERDComNestedComment* 3.2.2 Nested comment map *NERDComNestedComment*


Default mapping: [count]<leader>cn Default mapping: [count]<leader>cn
Mapped to: <plug>NERDCommenterNest Mapped to: <plug>NERDCommenterNest
Expand All @@ -159,7 +180,7 @@ Related options:
|'NERDDefaultNesting'| |'NERDDefaultNesting'|


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.2.3 Toggle comment map *NERDComToggleComment* 3.2.3 Toggle comment map *NERDComToggleComment*


Default mapping: [count]<leader>c<space> Default mapping: [count]<leader>c<space>
Mapped to: <plug>NERDCommenterToggle Mapped to: <plug>NERDCommenterToggle
Expand All @@ -176,7 +197,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* 3.2.4 Minimal comment map *NERDComMinimalComment*


Default mapping: [count]<leader>cm Default mapping: [count]<leader>cm
Mapped to: <plug>NERDCommenterMinimal Mapped to: <plug>NERDCommenterMinimal
Expand All @@ -198,7 +219,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.5 Invert comment map *NERDComInvertComment* 3.2.5 Invert comment map *NERDComInvertComment*


Default mapping: <leader>ci Default mapping: <leader>ci
Mapped to: <plug>NERDCommenterInvert Mapped to: <plug>NERDCommenterInvert
Expand All @@ -215,7 +236,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.6 Sexy comment map *NERDComSexyComment* 3.2.6 Sexy comment map *NERDComSexyComment*


Default mapping: [count]<leader>cs Default mapping: [count]<leader>cs
Mapped to: <plug>NERDCommenterSexy Mapped to: <plug>NERDCommenterSexy
Expand All @@ -235,7 +256,7 @@ Related options:
|'NERDCompactSexyComs'| |'NERDCompactSexyComs'|


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.2.7 Yank comment map *NERDComYankComment* 3.2.7 Yank comment map *NERDComYankComment*


Default mapping: [count]<leader>cy Default mapping: [count]<leader>cy
Mapped to: <plug>NERDCommenterYank Mapped to: <plug>NERDCommenterYank
Expand All @@ -244,7 +265,7 @@ Applicable modes: normal visual visual-line visual-block.
Same as <leader>cc except that it yanks the line(s) that are commented first. Same as <leader>cc except that it yanks the line(s) that are commented first.


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.2.8 Comment to EOL map *NERDComEOLComment* 3.2.8 Comment to EOL map *NERDComEOLComment*


Default mapping: <leader>c$ Default mapping: <leader>c$
Mapped to: <plug>NERDCommenterToEOL Mapped to: <plug>NERDCommenterToEOL
Expand All @@ -254,7 +275,7 @@ 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* 3.2.9 Append com to line map *NERDComAppendComment*


Default mapping: <leader>cA Default mapping: <leader>cA
Mapped to: <plug>NERDCommenterAppend Mapped to: <plug>NERDCommenterAppend
Expand All @@ -264,7 +285,7 @@ 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 Insert comment map *NERDComInsertComment* 3.2.10 Insert comment map *NERDComInsertComment*


Default mapping: disabled by default. Default mapping: disabled by default.
Map it to: <plug>NERDCommenterInInsert Map it to: <plug>NERDCommenterInInsert
Expand All @@ -280,7 +301,7 @@ mapping add >
to your vimrc. to your vimrc.


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.2.11 Use alternate delims map *NERDComAltDelim* 3.2.11 Use alternate delims map *NERDComAltDelim*


Default mapping: <leader>ca Default mapping: <leader>ca
Mapped to: <plug>NERDCommenterAltDelims Mapped to: <plug>NERDCommenterAltDelims
Expand All @@ -293,7 +314,7 @@ then they will be switched over to /**/ comments.
See also |NERDComDefaultDelims| See also |NERDComDefaultDelims|


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.2.12 Comment aligned maps *NERDComAlignedComment* 3.2.12 Comment aligned maps *NERDComAlignedComment*


Default mappings: [count]<leader>cl [count]<leader>cb Default mappings: [count]<leader>cl [count]<leader>cb
Mapped to: <plug>NERDCommenterAlignLeft Mapped to: <plug>NERDCommenterAlignLeft
Expand All @@ -308,7 +329,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.13 Uncomment line map *NERDComUncommentLine* 3.2.13 Uncomment line map *NERDComUncommentLine*


Default mapping: [count]<leader>cu Default mapping: [count]<leader>cu
Mapped to: <plug>NERDCommenterUncomment Mapped to: <plug>NERDCommenterUncomment
Expand All @@ -331,41 +352,7 @@ Related options:
|'NERDRemoveExtraSpaces'| |'NERDRemoveExtraSpaces'|


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.3 Supported filetypes *NERDComFiletypes* 3.3 Sexy Comments *NERDComSexyComments*

Filetypes that can be commented by this plugin:
abaqus abc acedb ada ahdl amiga aml ampl ant apache apachestyle asm68k asm asn
aspvbs atlas autohotkey autoit automake ave awk basic b bc bdf bib bindzone
bst btm caos catalog c cfg cg ch changelog cl clean clipper cmake conf config
context cpp crontab cs csc csp css cterm cupl csv cvs dcl debchangelog
debcontrol debsources def diff django docbk dns dosbatch dosini dot dracula
dsl dtd dtml dylan ecd eiffel elf elmfilt erlang eruby eterm expect exports
fetchmail fgl focexec form fortran foxpro fstab fvwm fx gdb gdmo geek
gentoo-package-keywords' gentoo-package-mask' gentoo-package-use' gnuplot
gtkrc haskell hb h help hercules hog html htmldjango htmlos ia64 icon idlang
idl indent inform inittab ishd iss ist jam java javascript jess jgraph
jproperties jproperties jsp kconfig kix kscript lace lex lftp lifelines lilo
lisp lite lotos lout lprolog lscript lss lua lynx m4 mail make maple masm
master matlab mel mf mib mma model moduala. modula2 modula3 monk mush muttrc
named nasm nastran natural ncf netdict netrw nqc nroff nsis objc ocaml occam
omlet omnimark openroad opl ora otl ox pascal passwd pcap pccts perl pfmain
php phtml pic pike pilrc pine plaintex plm plsql po postscr pov povini ppd
ppwiz procmail progress prolog psf ptcap python python qf radiance ratpoison r
rc readline rebol registry remind rexx robots rpl rtf ruby sa samba sas sass
sather scheme scilab screen scsh sdl sed selectbuf sgml sgmldecl sgmllnx sh
sicad simula sinda skill slang sl slrnrc sm smarty smil smith sml snnsnet
snnspat snnsres snobol4 spec specman spice sql sqlforms sqlj sqr squid st stp
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
verilog_systemverilog vgrindefs vhdl vim viminfo virata vo_base vrml vsejcl
webmacro wget winbatch wml wvdial xdefaults xf86conf xhtml xkb xmath xml
xmodmap xpm2 xpm xslt yacc yaml z8a

If a language is not in the list of hardcoded supported filetypes then the
&commentstring vim option is used.

------------------------------------------------------------------------------
2.4 Sexy Comments *NERDComSexyComments*
These are comments that use one set of multipart comment delimiters as well as These are comments that use one set of multipart comment delimiters as well as
one other marker symbol. For example: > one other marker symbol. For example: >
/* /*
Expand All @@ -380,7 +367,7 @@ one other marker symbol. For example: >
Here the multipart delimiters are /* and */ and the marker is *. Here the multipart delimiters are /* and */ and the marker is *.


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.5 The NERDComment function *NERDComNERDComment* 3.4 The NERDComment function *NERDComNERDComment*


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
Expand All @@ -404,10 +391,10 @@ then the script would do a sexy comment on the last visual selection.




============================================================================== ==============================================================================
3. Options *NERDComOptions* 4. Options *NERDComOptions*


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
3.1 Options summary *NERDComOptionsSummary* 4.1 Options summary *NERDComOptionsSummary*


|'loaded_nerd_comments'| Turns off the script. |'loaded_nerd_comments'| Turns off the script.
|'NERDAllowAnyVisualDelims'| Allows multipart alternative delims to |'NERDAllowAnyVisualDelims'| Allows multipart alternative delims to
Expand Down Expand Up @@ -444,7 +431,7 @@ then the script would do a sexy comment on the last visual selection.
style sexy comments. style sexy comments.


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
3.3 Options details *NERDComOptionsDetails* 4.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
Expand Down Expand Up @@ -716,7 +703,7 @@ Example: java uses // style comments by default, but you want it to default to
See |NERDComAltDelim| for switching commenting styles at runtime. See |NERDComAltDelim| for switching commenting styles at runtime.


============================================================================== ==============================================================================
4. Key mapping customisation *NERDComMappings* 5. Key mapping customisation *NERDComMappings*


To change a mapping just map another key combo to the internal <plug> mapping. To change a mapping just map another key combo to the internal <plug> mapping.
For example, to remap the |NERDComComment| mapping to ",omg" you would put For example, to remap the |NERDComComment| mapping to ",omg" you would put
Expand All @@ -731,11 +718,11 @@ map to.
See also |'NERDCreateDefaultMappings'|. See also |'NERDCreateDefaultMappings'|.


============================================================================== ==============================================================================
5. Issues with the script *NERDComIssues* 6. Issues with the script *NERDComIssues*




------------------------------------------------------------------------------ ------------------------------------------------------------------------------
5.1 Delimiter detection heuristics *NERDComHeuristics* 6.1 Delimiter detection heuristics *NERDComHeuristics*


Heuristics are used to distinguish the real comment delimiters Heuristics are used to distinguish the real comment delimiters


Expand All @@ -755,7 +742,7 @@ string. These heuristics, while usually pretty accurate, will not work for all
cases. cases.


------------------------------------------------------------------------------ ------------------------------------------------------------------------------
5.2 Nesting issues *NERDComNesting* 6.2 Nesting issues *NERDComNesting*


If we have some line of code like this: > If we have some line of code like this: >
/*int foo */ = /*5 + 9;*/ /*int foo */ = /*5 + 9;*/
Expand All @@ -775,7 +762,7 @@ will become: >
for simplicity) for simplicity)


============================================================================== ==============================================================================
6. About *NERDComAbout* 7. About *NERDComAbout*


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
Expand Down Expand Up @@ -849,7 +836,7 @@ The latest dev versions are on github
NERDComInsertComment if you wish to restore it NERDComInsertComment if you wish to restore it


============================================================================== ==============================================================================
8. Credits *NERDComCredits* 9. Credits *NERDComCredits*


Thanks to the follow people for suggestions and patches: Thanks to the follow people for suggestions and patches:


Expand Down Expand Up @@ -986,7 +973,7 @@ Matt Tolton javacc
Ivan Devat javascript.jquery Ivan Devat javascript.jquery
tpope cucumber,pdf tpope cucumber,pdf
============================================================================== ==============================================================================
9. License *NERDComLicense* 10. License *NERDComLicense*


The NERD commenter is released under the wtfpl. The NERD commenter is released under the wtfpl.
See http://sam.zoy.org/wtfpl/COPYING. See http://sam.zoy.org/wtfpl/COPYING.

0 comments on commit 5c9359d

Please sign in to comment.