sponsor Vim development Vim logo Vim Book Ad

comments.vim : Simple, flexible commenting script

 script karma  Rating 21/8, Downloaded by 1410  Comments, bugs, improvements  Vim wiki

created by
Jérôme Plût
 
script type
utility
 
description
This is yet another script to do some code commenting/uncommenting. It is simple and easy to use, and should work for almost any filetype.

It defines a command :CommentStyle which takes one argument, which can be either a comment prefix ("# " for shell) or a comment string ("/* @ */" for C) with a @ as a placeholder.
It also defines three mappings: >c to comment, <c to uncomment, and =c to change the CommentStyle.

Nested comments are handled correctly (this means that if you comment the following C code line:
x /* comment */ ++;
then the inner comment will be protected).
 
install details
Drop into 'runtimepath' and say :runtime comments.vim .
Included are default settings for some filetypes. Add your own if needed.

This is an UTF-8 encoded file, but as non-ASCII characters are used only as placeholders, this should cause no problem.
 

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
comments.vim 1.0 2007-11-29 6.0 Jérôme Plût Initial upload
ip used for rating: 3.137.185.180

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 the maillist. Help Bram help Uganda.
   
Vim at Github