links: 010 Vim MOC


To comment out blocks:

  • press Esc (to leave editing or other mode)
  • hit ctrl + v (visual block mode)
  • use / /j/k/gg/ G any keys and select lines to comment (it won’t highlight everything - it’s OK)
  • Shift + i (capital I)
  • insert the text you want. ex: //
  • press Esc Esc (double escape)

To uncomment blocks in vim

  • press Esc (to leave editing or other mode)

  • hit ctrl + v (visual block mode)

  • use / /j/k/gg/ G any keys and select lines to uncomment

    If you want to select multiple characters, use one or combine these methods:

    • use the left/right arrow keys to select more text
    • to select chunks of text use shift + / arrow key
    • you can repeatedly push the delete keys below, like a regular delete button
  • press d or x to delete characters, repeatedly if necessary


tags: vim