DEV Community

JhenYu Yang
JhenYu Yang

Posted on

Answer: What's a quick way to comment/uncomment lines in Vim?

To comment out blocks in vim:

  • press Esc (to leave editing or other mode)
  • hit ctrl+v (visual block mode)
  • use the / arrow keys to select lines you want (it won't highlight everything - it's OK!)
  • Shift+i (capital I)
  • insert the text you want…

Discussion (0)