Vim Tips Multiline Comment

I ran across this hidden gem today in Vim.

  1. Enter visual mode by pressing Ctrl-v.
  2. Next select the lines you want then press Shift-i.
  3. After that insert the comment character(s). I use Ruby so I entered '#'.
  4. Finally press escape and you will have a nice block of comments inserted.

Happy Vim'er!