7

I found a command in NERDCommenter like this:

[count]<leader>cc |NERDComComment|

I have installed the plugin. But, I don't know how to make it work. So what's the meaning of that command? How can I make it work?

Rich
  • 31,891
  • 3
  • 72
  • 139
Mas Bagol
  • 527
  • 1
  • 4
  • 14

2 Answers2

13

So, if you want to comment out the current line: use \cc from normal mode. For the current and next line, use 2\cc, etc.
You you can select lines with visual mode and then press \cc to comment out all the selected lines.

Martin Tournoij
  • 62,054
  • 25
  • 192
  • 271
2

The command is used in normal mode by typing first a count, like 10, followed by the <Leader> key (default is \) and finally cc.

Example; type 10\cc in normal mode to comment out 10 lines starting at the cursor position. Omit the count to only comment out the current line.

Many people like to remap the <Leader> key to ,. More info here: http://usevim.com/2012/07/20/vim101-leader/

thrawny
  • 21
  • 1