Vim Paste/NoPaste

To toggle "paste" mode for Vim, do this to enable ctrl-v with proper indentation.

:set paste

Remember to type the ":" initially to enter command mode. You are then saying "set paste".

When you're done, reset to non-paste mode:

:set nopaste


Commenting multiple lines in vim

to comment multiple lines in vim editor without using a plugin, try:

  • ctrl+v (block-visual selection mode)
  • select the first character of the lines with arrow keys
  • shift+i (insert mode)
    *type the comment marker: #
  • esc

... and wait. Takes a second or two for the characters to paint in.