Comment a section in Vim

To comment out blocks in vim:

  • hit ctrl+v (visual block mode)
  • use the down arrow keys to select the lines you want (it won’t highlight everything)
  • Shift+i (capital I)
  • insert the text you want, i.e. ‘% ‘
  • Press ESC

Give it a second to work.

All credits to  http://stackoverflow.com/questions/1676632/whats-a-quick-way-to-comment-uncomment-lines-in-vim

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s