comment blocks in vim

This is for block editing in general, actually. Mark the area which is to be commented using the blockwise visual mode (CTRL-V).

Press I (capital i) and write the text you want to prepend to each line of the selected block, e.g. #

Critical part: Then press ESC and the text will be inserted to the left of each line of the selected block.

from: notfaq.wordpress.com/…/vim-comment-blocks-of-code

 
  1. vjcharles posted this
Blog comments powered by Disqus