The NERD Commenter - A plugin that allows for easy commenting of code for many filetypes. : vim online
Keywords: Vim, Vi IMproved, text editor, home, documentation, tips, scripts, news

The NERD Commenter : A plugin that allows for easy commenting of code for many filetypes.
script karma | Rating 276/106, Downloaded by 3826
created by
Marty Grenfell
script type
utility
description
This plugin defines key mappings for easy commenting of various file types using consistent keystokes over all supported filetypes. A help page is installed with this script. Go :help NERD_comments to see it Functionality provided: The following key mappings are provided by default (there is also a menu provided that contains menu items corresponding to all the below mappings) Note that the keys used for these mappings can be customised, go :help NERD_com-Customisation for details. Note: <leader> is a user defined key that is used to start keymappings and defaults to \. Check out |<leader>| for details. Most of the following mappings are for normal/visual/visual-block/visual-line mode only. The |NERD_com-insert-comment| mapping is for insert mode only. <leader>cc |NERD_com-comment-map| Comments out the current line or text selected in visual mode. <leader>cn |NERD_com-nested-comment| Same as |NERD_com-comment-map| but enforces nesting. <leader>c<space> |NERD_com-toggle-comment| Toggles the comment state of the selected line(s). If the topmost selected line is commented, all selected lines are uncommented and vice versa. <leader>cm |NERD_com-minimal-comment| Comments the given lines using only one set of multipart delimiters if possible. <leader>ci |NERD_com-invert-comment| Toggles the comment state of the selected line(s) individually. Each selected line that is commented is uncommented and vice versa. <leader>cs |NERD_com-sexy-comment| Comments out the selected lines ``sexually'' <leader>cy |NERD_com-yank-comment| Same as |NERD_com-comment-map| except that the commented line(s) are yanked before commenting. <leader>c$ |NERD_com-EOL-comment| Comments the current line from the cursor to the end of line. <leader>cA |NERD_com-append-comment| Adds comment delimiters to the end of line and goes into insert mode between them. <leader>cI |NERD_com-prepend-comment| Adds comment delimiters to the start of line and goes into insert mode between them. <C-c> |NERD_com-insert-comment| Adds comment delimiters at the current cursor position and inserts between. <leader>ca |NERD_com-alt-delim| Switches to the alternative set of delimiters. <leader>cl OR <leader>cr OR <leader>cb |NERD_com-aligned-comment| Same as |NERD_com-comment| except that the delimiters are aligned down the left side (<leader>cl), the right side (<leader>cr) or both sides (<leader>cb). <leader>cu |NERD_com-uncomment-line| Uncomments the selected line(s). Files that can be commented by this plugin: abaqus abc acedb ada ahdl amiga aml ampl ant apache apachestyle asm68k asm asm asn aspvbs atlas automake ave awk basic b bc bdf bib bindzone btm caos catalog c cfg cg ch cl clean clipper conf config cpp crontab cs csc csp css cterm cupl cvs dcl def diff dns dosbatch dosini dot dracula dsl dtd dtml dylan ecd eiffel elf elmfilt erlang eterm expect exports fgl focexec form fortran foxpro fvwm fx gdb gdmo gnuplot gtkrc haskell hb h help hercules hog html htmlos ia64 icon idlang idl indent inform inittab ishd iss ist jam java javascript jess jgraph jproperties jproperties jsp kix kscript lace lex lftp lifelines lilo lisp lite lotos lout lprolog lscript lss lua lynx m4 make maple masm master matlab mel mf mib mma model moduala. modula2 modula3 monk mush muttrc named nasm nastran natural ncf nqc nsis ocaml omnimark openroad opl ora ox pascal pcap pccts perl pfmain php phtml pic pike pilrc pine plm plsql po postscr pov povini ppd ppwiz procmail progress prolog psf ptcap python python radiance ratpoison r rc readline rebol registry remind rexx robots rpl ruby sa samba sas sather scheme scilab screen scsh sdl sed sgml sgmldecl sgmllnx sicad simula sinda skill slang sl slrnrc sm smil smith sml snnsnet snnspat snnsres snobol4 spec specman spice sql sqlforms sqlj sqr squid st stp strace tads tags tak tasm tcl terminfo tex texinfo texmf tf tidy tli trasys tsalt tsscl tssgm uc uil vb verilog vgrindefs vhdl vim virata vrml vsejcl webmacro wget winbatch wml sh wvdial xdefaults xf86conf xkb xmath xml xmodmap xpm2 xpm xslt yacc z8a If a language is not in the list of hardcoded supported filetypes then the &commentstring vim option is used. There are some options that the script provides, go :help NERD_com-Customisation for details
install details
Stick it in the plugin directory. The help doc should be installed when you next run vim. If it isnt then you can find it at the bottom of the script.
rate this script | Life Changing Helpful Unfulfilling
script versions (upload new version) Click on the package to download.
package | script version | date | Vim version | user | release notes
--- | --- | --- | --- | --- | ---
NERD_comments.vim | 1.69 | 2006-09-08 | 6.0 | Marty Grenfell | fixed a bug when initializing vb comment delimiters (cheers to boesi for pointing it out). Added support for the following filetypes: debsources, eruby, xhtml and yaml. Added "dummy" support for the following filetypes: netrw, svn, taglist, and the null filetype. These filetypes have no comment delimiters but now that NERD knows about them it doesnt complain anymore.
NERD_comments.vim | 1.68 | 2006-08-13 | 6.0 | Marty Grenfell | Added an option called NERD_mapleader which allows you to change the two keys that all the mappings begin with by default. This will allow users to change all mappings easily so they dont conflict with any other plugins. Thanks to Tim Carey-Smith and Gary Church whose complaints prompted me to make this option :)
NERD_comments.vim | 1.67 | 2006-05-18 | 7.0 | Marty Grenfell | Replaced the NERD_dont_create_menu_shortcut option with NERD_menu_mode. This new option allows the user to specify 1) whether a comment menu should be made and 2) whether this menu should have <alt>-c as a shortcut. Go :help NERD_menu_mode for more info. Thanks to Joseph Barker for the sugesting that the menu should be an optional feature. Added suppport for plaintex, context and mail filetypes (when commenting a "mail" file "> " is used as the left delimiter so that the commented text appears as quoted text in the email). Thanks to Jonathan Derque for emailing me with these filetypes.
NERD_comments.vim | 1.66 | 2006-04-18 | 6.0 | Marty Grenfell | Applied a patch that Norick Chen emailed to me that fixed the asp delimiters (which were wrong and caused an error) Thanks Norick :)
NERD_comments.vim | 1.65 | 2006-04-11 | 6.0 | Marty Grenfell | Made minimal comments use the NERD_place_holder_regexp option. Now if place holders are needed but are disabled for the current filetype then the minimal comment is aborted. Thanks to Stefano Zacchiroli emailing me and prompting this change. Fixed a minor bug with minimal comments.
NERD_comments.vim | 1.64 | 2006-04-09 | 6.0 | Marty Grenfell | Refactored the code a bit and removed the NERD_use_toggle_coms_default and NERD_use_sexy_coms_default_regexp options. Now you have to adjust the key mappings to achieve the same effects as these options Sexy comments now always use the c style delimiters if they are available (even if another set of multipart delims is available) because they generally look the best. Fixed a bug that occured when using the tabs in vim7 (thanks to Harry for pointing it out:). Added a new commenting type called "minimal" comments where a SINGLE set of multipart delimiters is used to comment out a bunch of lines. Go :help NERD_com-minimal-comment for details. Thanks to Stefano Zacchiroli for this suggestion. Fixed some random little bugs.
NERD_comments.vim | 1.63 | 2006-02-12 | 6.0 | Marty Grenfell | fixed a bug that was stopping the NERD_space_delim_filetype_regexp option from working with left aligned toggle comments. Thanks to boesi for pointing this out.
NERD_comments.vim | 1.62 | 2006-01-17 | 6.0 | Marty Grenfell | Fixed 2 bugs that caused problems when uncommenting sexy comments. Thanks to Torsten Blix for emailing me about them.
NERD_comments.vim | 1.61 | 2006-01-14 | 6.0 | Marty Grenfell | Applied a patch sent to me by Eike Von Seggern that fixed a bug that caused a space to be added to the end of the line when commenting with single-part delimiters.
NERD_comments.vim | 1.60 | 2006-01-10 | 6.0 | Marty Grenfell | Added a new option that turns off the NERD_comments menu shortcut (Alt-c) which could interfere with other (Non-NERD) mappings. Thanks to Nguyen for pointing out this problem :)
NERD_comments.vim | 1.59 | 2005-10-25 | 6.0 | Marty Grenfell | fixed a small bug that was causing problems with spaces around delimiters.
NERD_comments.vim | 1.58 | 2005-10-24 | 6.0 | Marty Grenfell | fixed a bug that could be a problem when changing buffers. Thanks to David Bourgeois for pointing it out.
NERD_comments.vim | 1.57 | 2005-10-21 | 6.0 | Marty Grenfell | Fixed a retarded bug when commenting c files (thanks to David Bourgeois for pointing it out). Changed the NERD_dont_remove_spaces option to NERD_dont_remove_spaces_regexp and made it take a regular expression. Go :help NERD_dont_remove_spaces_regexp for details. Put a section in the help file that gives some examples of regular expressions that you may want to use for some of the options. Go :help NERD_com-reg-exps for details.
NERD_comments.vim | 1.56 | 2005-10-01 | 6.0 | Marty Grenfell | Tweaked the behaviour of the "toggle comment" mapping: now if you are commenting a range (with toggle comments) and you have the NERD_use_nested_comments_default option turned on it will comment the already comment lines again. Cheers to Igor Prischepoff for this suggestion. I also reorgansied the help page and added some stuff to make it more readable :)
NERD_comments.vim | 1.55 | 2005-09-14 | 6.0 | Marty Grenfell | made the \ci mapping work with whole lines line the \c<space> mapping does i.e the mapping only counts a line as commented if it commented from the start of the line. Fixed a couple of silly bugs
NERD_comments.vim | 1.54 | 2005-09-13 | 6.0 | Marty Grenfell | Fixed the \cn mapping that i broke in the last version. Thanks to harry for pointing that out. Changed the behaviour of toggle comments: now lines are only counted as commented if they are commented from the beginning of the line. Thanks to Igor Prischepoff for suggesting this. I applied a patch by Richard (Krischikm) which fixed a couple of bugs and added a new option (see :help NERD_use_ada_with_spaces for details). I changed how the script handles tabs: now each line is examined individually instead of using examining the &expandtabs option and assuming it applies to every line. The script should not interfere with the tabbing style of any file you edit now... even if they alternate between soft and hard tabs with each line :). Stopped the cursor jumping when the \cu mapping is used.
NERD_comments.vim | 1.53 | 2005-09-12 | 6.0 | Marty Grenfell | Made some changes to how spaces around comments are removed when uncommenting... basically they are always removed unless the new option NERD_dont_remove_spaces is set. Go :help NERD_dont_remove_spaces for details. I added this functionality because i usually dont have NERD_comments adding spaces after/before the left/right delimiters but when im editing code written by people who DO it makes me insane because it is uncommented incorrectly. Fixed the cursor and screen jumping bugs... hopefully :)
NERD_comments.vim | 1.52 | 2005-09-06 | 6.0 | Marty Grenfell | Fixed an error in the help file. Added support for // comments in c. Made an option to turn these // comments on by default (go :help NERD_use_single_part_c_comments for details). Thanks to Richard Willis whose feedback prompted these changes :)
NERD_comments.vim | 1.51 | 2005-09-05 | 6.0 | Marty Grenfell | Added yet another mapping (<leader>ci) which inverts the commented state of every selected line. i.e. for each line selected, if it is commented it is uncommented and vice versa. Thanks to Nick Brettell for the idea. Improved the cursor positioning after commenting is done so if you do a visual comment the cursor returns to a better position. Removed some line continuations that were screwing up on some systems. Thanks to Richard for pointing that out to me.
NERD_comments.vim | 1.50 | 2005-08-31 | 6.0 | Marty Grenfell | Added a new mapping <leader>c<space> that toggles the comment state of the selected lines. It uncomments all the lines if the first line is commented and comments them otherwise. The mapping can be changed with this option: NERD_com_line_toggle_map. Toggle commenting can be made the default commenting method (so it applied when <leader>cc is pressed) with this option: NERD_use_toggle_coms_default. Thanks to Igor Prischepoff for the idea :)
NERD_comments.vim | 1.49 | 2005-08-30 | 6.0 | Marty Grenfell | Fixed a bug that was causing problems when the ignorecase option in vim was set. Thanks to Brent Rice for telling me about this problem and helping me track the bug down :)
NERD_comments.vim | 1.48 | 2005-08-28 | 6.0 | Marty Grenfell | Fixed a bug with sexy comments that was stopping them from working when you were using the alternative set of delimiters for some languages (eg c/java/etc)
NERD_comments.vim | 1.47 | 2005-08-25 | 6.0 | Marty Grenfell | Fixed bugs with sexy comments (most of the bugs were only an issue when using compact sexy comments): Now they work properly if they end on a blank line. When uncommenting sexy comments the display window doesnt jump anymore. If the sexy comment starts or ends on another ordinary comment it no longer screws up. Sexy comments no longer delete parts of lines (which they did from time to time). Blank lines above compact sexy comments are no longer removed when uncommenting. Fixed another bug with the <C-c> mapping.
NERD_comments.vim | 1.46 | 2005-07-17 | 6.0 | Marty Grenfell | enhanced the option: NERD_comment_whole_lines_in_v_mode so that it can now take 2 values. Go :help NERD_comment_whole_lines_in_v_mode for an explaination. Thanks to jorge scandaliaris for emailing me with his criticism about this :)
NERD_comments.vim | 1.45 | 2005-07-14 | 6.0 | Marty Grenfell | Now the script doesnt create a seperate filetype for h files unless you tell it to with a new option called NERD_create_h_filetype. Go :help NERD_create_h_filetype for more info. This update was done to prevent NERD_comments from screwing with the taglist plugin. Thanks to Markus Erlmann for pointing out that it caused problems.
NERD_comments.vim | 1.44 | 2005-07-06 | 6.0 | Marty Grenfell | Fixed a bug with the <C-c> mapping after i broke it (again :(). Thanks to Martin Stubenschrott for pointing this bug out!
NERD_comments.vim | 1.43 | 2005-06-30 | 6.0 | Marty Grenfell | Fixed a bug with visual commenting. Added a new option, go :help NERD_comment_whole_lines_in_v_mode for details. Thanks to jorge scandaliaris and Shufeng Zheng for their suggestions about this.
NERD_comments.vim | 1.42 | 2005-06-26 | 6.0 | Marty Grenfell | Now, when any visual comments are made, the cursor is placed at the top left line/col of the visual selection block after the comment is done instead of on the top line at the first col. Thanks to Nick Brettell for complaining about this. Added support for .geek files hahahaha
NERD_comments.vim | 1.41 | 2005-06-16 | 6.0 | Marty Grenfell | fixed a small bug with the <C-c> functionality when the script is configured to put extra spaces between the delimiters.
NERD_comments.vim | 1.40 | 2005-05-18 | 6.0 | Marty Grenfell | Fixed a bug that was screwing up place holders with nested commenting when NERD_use_nested_comments_default option is set. Changed the left and right default place holders because the strings that were being used were sort of common in c/c++/java/... files. If you liked them the way they were you can just set them back with the NERD_lPlace and NERD_rPlace options. Thanx to Nick for complaining about the place holders and spotting the other bug :P
NERD_comments.vim | 1.39 | 2005-05-15 | 6.0 | Marty Grenfell | Fixed a retarded bug with the <C-c> mapping. Changed the <leader>ce mapping to have a default mapping of <leader>cA and added a new mapping that adds a comment delimiter to the start of the current line and inserts between the delimiters - the default mapping is <leader>cI (thats an uppercase i not a lowercase L). Fixed a bug that caused the script to spaz out if you tried to comment a file with no filetype.
NERD_comments.vim | 1.38 | 2005-05-13 | 6.0 | Marty Grenfell | Added new functionality for when text is commented in normal visual mode (i.e not visual-block or visual-line). Now Nerd_comments comments out exactly the text that is selected in visual mode regardless of the type of visual mode you are in. Thanks to Nick Brettell his ideas about this! Also, if you are commenting out text in visual or visual-block mode, NERD_comments will use multip-part delimiters is they are available so that the exact text that was selected will be exactly what is commented out - a new option has been added to turn off this behaviour (go :help NERD_allow_any_visual_delims_regexp for details). Fixed a couple of small bugs with the <C-c> mapping that prolly on one even noticed :P
NERD_comments.vim | 1.37 | 2005-05-09 | 6.0 | Marty Grenfell | Added a new mapping/menu item: Now when <leader>ce is pressed a comment is appended to the EOL and the cursor gets put in insert mode in the appropriate place to type the comment. Thanks to Litchi for emailing me with this idea :)
NERD_comments.vim | 1.36 | 2005-05-08 | 6.0 | Marty Grenfell | added lots more supported filetypes
NERD_comments.vim | 1.35 | 2005-05-04 | 6.0 | Marty Grenfell | Added support for some new filetypes. Fixed a small bug with sexy comments. Fixed a bug with tabs that was not too serious but would screw up commenting of things like makefiles in a big way. Cheers to Nick Brettell for pointing this bug out!
NERD_comments.vim | 1.34 | 2005-04-29 | 6.0 | Marty Grenfell | Add support for a couple more filetypes. Thanks to Sam R for emailing me about them!
NERD_comments.vim | 1.33 | 2005-04-29 | 6.0 | Marty Grenfell | added a new mapping/menuItem that yanks the current line or selected text before commenting it out. This is handy if you wanna experiment with a piece of code... u just comment out the code and put a copy underneath it that you experiment on.
NERD_comments.vim | 1.32 | 2005-04-25 | 6.0 | Marty Grenfell | now, if the current filetype matches NERD_use_sexy_coms_default_regexp then sexy comments will only be used if you are commenting more than one line with <leader>cc... i thought sexy comments on one line looked retarded. Of course you can still do one line sexy comments with <leader>cs
NERD_comments.vim | 1.31 | 2005-04-25 | 6.0 | Marty Grenfell | Added a new option called NERD_use_sexy_coms_default_regexp. This option is used to tell NERD_comments to use sexy comments for certain filetypes by default when <leader>cc is pressed. Now if you edit a filetype that the script doesnt know about the warning it echos isnt so "loud" Thanks to Nguyen for suggesting these changes.
NERD_comments.vim | 1.30 | 2005-04-22 | 6.0 | Marty Grenfell | Have finally implemented "sexy" comments. Go :help NERD_com_sexy_commenting to see what they are... i cant even be stuffed explaining. There is an option to make your sexy comments compact and use up less lines, go :help NERD_use_compact_sexy_com_regexp. Thanks to Nguyen for the idea... sorry it took so long dude :P
NERD_comments.vim | 1.29 | 2005-04-18 | 6.0 | Marty Grenfell | There are a couple of new options to tell NERD_comments to always left align, right align or both align, comment delimiters when commenting multiple lines in visual mode. Go :help NERD_left_align_regexp, :help NERD_right_align_regexp. If the current filetype matches one or both of these regular expressions then hitting <leader>cc will automatically align the delimiters. There are comment mappings/menu items which can be used to do aligned comments for any filetype. The mappings are <leader>cl <leader>cr and <leader>cb for left, right and both aligned comments respectively. These mappings and menu items assume that the comments will be nested if need be. Now, when uncommenting lines, the script looks for left and right delimiters separately so for eg: if you uncomment a line with one right delimiter on it (but no left delim) then it will still be removed. Fixed a couple of minor bugs.
NERD_comments.vim | 1.28 | 2005-04-12 | 6.0 | Marty Grenfell | Added a menu with menu items for each of the scripts key mappings. Refactored the code a bit. Now, if you edit a filetype that vim doesnt know about the script wont crap out. Added support for a couple more filetypes.
NERD_comments.vim | 1.27 | 2005-04-06 | 6.0 | Marty Grenfell | a few bug fixes
NERD_comments.vim | 1.26 | 2005-04-05 | 6.0 | Marty Grenfell | Removed an echoerr that i forgot to remove from last release...
NERD_comments.vim | 1.25 | 2005-04-04 | 6.0 | Marty Grenfell | Updated comment recognition heuristics. Modified the place holder system a bit so it is better. Did some refactoring to simplify the code a bit. Fixed some random bugs
NERD_comments.vim | 1.24 | 2005-04-01 | 6.0 | Marty Grenfell | Fixed some bugs with place holders. Parameterised some of the place holder stuff to make it more customisable. There are now 3 more options: NERD_lPlace, NERD_rPlace and NERD_place_holder_regexp. These options are used to control the strings that are used as place holders and to specify the filetypes NERD_comments will use place holders for. Go :help and the name of each option for more info Now when a line is uncommented, the outtermost delimiters are removed regardless of whether they are the alternative delimiters for that filetype or not
NERD_comments.vim | 1.23 | 2005-04-01 | 6.0 | Marty Grenfell | Added support for place holders when nesting comments with left AND right delimiters. Now if you go <leader>cn on a line of already commented code (eg: /* int foo */), the current delimiters will be swapped for place holders so the example line will become: /*[+ int foo +]*/ where [+ and +] are the place holders. Also, i fixed a pretty major bug with visual-block commenting
NERD_comments.vim | 1.22 | 2005-03-28 | 6.0 | Marty Grenfell | Fixed the syntax highlighting probs with h files. There is a new option which is used to place a space after the left delimiter and before the right delimiter. The option is set to a regular expression and any filetypes that match this expression have the aforementioned spaces added when commenting. Go :help NERD_space_delim_filetype_regexp for details. Thanks to Nguyen for pointing these emailing me about these things!!
NERD_comments.vim | 1.21 | 2005-03-26 | 6.0 | Marty Grenfell | fixed some bugs. added support for more filetypes
NERD_comments.vim | 1.20 | 2005-03-26 | 6.0 | Marty Grenfell | did some refactoring added support for more filetypes
NERD_comments.vim | 1.19 | 2005-03-24 | 6.0 | Marty Grenfell | If the filetype is unkown to the script it now looks at &commentstring to get the comment delimiters for that filetype
NERD_comments.vim | 1.18 | 2005-03-23 | 6.0 | Marty Grenfell | Block commenting is done automatically now... if you select some text in visual-block mode and go <leader>cc it will behave the same as if you pushed <leader>cb before. Similarly, if you select some text with visual-block mode and go <leader>cn it wll behave as if you had pushed <leader>cB the <leader>cb and <leader>cB mappings have now been removed cos they are redundant The comment recognition heuristics have been updated a little bit so NERD_comments is now a bit better at recognising comment delimiters
NERD_comments.vim | 1.17 | 2005-03-23 | 6.0 | Marty Grenfell | block commenting is much better now
NERD_comments.vim | 1.16 | 2005-03-21 | 6.0 | Marty Grenfell | umm, the script has been changed a lot... - the keymappings and options are different and there is waaaay more of them - there is now way more functionality provided by the script - there is a help file that is self-installing and fully contained in the script (i stole the installation function from the vimspell plugin (thx vimspell!!)) - the internals of the script are a bit more sophisticated in the way they recognise comments (they have to be cos of the new functionality) but it is not perfect at recognising comment delimiters (infact it only uses a set of heuristics)
NERD_comments.vim | 1.15 | 2005-03-15 | 6.0 | Marty Grenfell | Changed the guts of the script a bit. Now the imap for <C-c> is done automatically which means that adding support for commenting another language is really easy and takes just one line! Haskell and lisp are now supported There is a new function that is designed to handle programming languages with more than one commenting style which is a bit of a hack but works well. Theres another option NERD_use_c_style_prolog_comments
NERD_comments.vim | 1.14 | 2005-03-09 | 6.0 | Marty Grenfell | Did a bit of refactoring... no functionality changes. Thanks to Matthew Hawkins for pointing out the code repitition :P
NERD_comments.vim | 1.13 | 2005-03-07 | 6.0 | Marty Grenfell | - added a new option: NERD_use_c_comments_for_h_files. This option is needed cos h files are used with c files which only allow /**/ comments, but they are also used with c++/c# which allow // comments which are illegal in c - the option NERD_use_slash_star_java_cpp_comments now affects c# files as well. This means that c# files are now commented like c++/java files - added a new autocommand which sets the filetype to h if we enter a buffer with an h file in it. This was needed cos some versions of vim dont seem to have an h filetype. Some versions of vim treat h files as cpp files which screws everything up!!!
NERD_comments.vim | 1.12 | 2005-03-06 | 6.0 | Marty Grenfell | Fixed a bug with forced commenting (<leader><leader>c)
NERD_comments.vim | 1.11 | 2005-03-05 | 6.0 | Marty Grenfell | Some minor bug fixes and improvements
NERD_comments.vim | 1.10 | 2005-03-03 | 6.0 | Marty Grenfell | An additional mapping has been added: <leader><leader>c will now comment out the selected lines and will force nested commenting (provided the comment style has no right delimiter - to avoid compiler errors). Note that if the option NERD_allow_nested_comments is set then <leader>c performs this behaviour anyway...
NERD_comments.vim | 1.09 | 2005-03-01 | 6.0 | Marty Grenfell | - there is a new option NERD_allow_nested_comments which will allow nested comments provided that there is no right delimiter for that commenting style. This should prevent nested commenting errors. eg. the option will allow nested // style java comments (which will not produce compiler errors) but will not allow nested /* */ style c comments (which would cause compiler errors). The reason this feature has been added is the following: Say that you have commented out an entire function which already has comments in it... when you uncomment out the function, errors will result because of the comments that were already there that have been uncommented. This way those comments will become nested comments and the function will be exactly as it was before you commented it. - the option NERD_double_slash_java_comments has been changed to NERD_use_star_slash_java_cpp_comments. Now, when editing java/c++ file // style comments are used by default unless this option is set. This is to make it easier for ppl who want to use the nested comments option as well...
NERD_comments.vim | 1.08 | 2005-03-01 | 6.0 | Marty Grenfell | - Massive refactoring which has significantly reduced the size of the script - Corrections to some of the comment delimiters used - also the filetype event used in the auto commands that turn on the mappings has been capitalised to FileType to fix a problem with some versions of vim - version number is now in the script All of this was done by Matthew Hawkins... THANK YOU VERY MUCH !!! :)
NERD_comments.vim | 1.07 | 2005-02-28 | 6.0 | Marty Grenfell | - Now, when commenting lines of code, lines that are already commented out are not commented again - when commenting code, blank lines (or lines containing only spaces and/or tabs) are not commented - an option has been added which lets you have // style java comments instead of /* */ java comments just stick 'let NERD_double_slash_java_comments=1' in your vimrc
NERD_comments.vim | 1.06 | 2005-02-27 | 6.0 | Marty Grenfell | Now the left comment delimiter is placed in the position that the leftmost character occupies instead of at the start of the line. This means that indenting is preserved
NERD_comments.vim | 1.05 | 2005-02-27 | 6.0 | Marty Grenfell | fixed bug for removing comment delimiters added support for shite loads more filetypes
NERD_comments.vim | 1.04 | 2005-02-26 | 6.0 | Marty Grenfell | The functions that turn on the comment mappings are now local to the script
NERD_comments.vim | 1.03 | 2005-02-26 | 6.0 | Marty Grenfell | Now the comment mappings are loaded automatically.
NERD_comments.vim.gz | 1.02 | 2005-02-25 | 6.0 | Marty Grenfell | fixed some bugs. Comments now work for c. Also the hlsearch option is not potentially changed when the comment mappings are used
NERD_comments.vim.gz | 1.01 | 2005-02-25 | 6.0 | Marty Grenfell | err, various corrections to comments
NERD_comments.vim.gz | 1 | 2005-02-25 | 6.0 | Marty Grenfell | Initial upload

| If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly. Questions about Vim should go to vim@vim.org after searching the archive. Help Bram help Uganda. stats |  |