sponsor Vim development Vim logo Vim Book Ad

commentary.vim : Comment stuff out; takes a motion as a target

 script karma  Rating 98/127, Downloaded by 584    Comments, bugs, improvements  Vim wiki

created by
Tim Pope
 
script type
utility
 
description
Comment stuff out.  Use \\\ to comment out a line (takes a count), \\ to comment out the target of a motion (for example, \\ap to comment out a paragraph), and \\ in visual mode to comment out the selection.  That's it.

Install repeat.vim, vimscript #2136, to enable repeating with . the line commenting map \\\.

I wrote this because 5 years after Vim added support for mapping an operator, I still couldn't find a commenting plugin that leveraged that feature (I overlooked vimscript #1173).  Striving for minimalism, the first version weighs in at just 35 lines of code.

Oh, and it uncomments, too.

https://github.com/tpope/vim-commentary
 
install details
You know the drill.
 

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
commentary.zip 1.1 2011-08-28 7.0 Tim Pope Smarter indentation handling.
Always pad with whitespace.
Support nesting: /* /1* abc *1/ */.
Support custom maps.
commentary.zip 1.0 2011-08-20 7.0 Tim Pope Initial upload
ip used for rating: 23.20.196.179

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.
   
SourceForge.net Logo