How to Comment and Uncomment Multiple Lines in Vim

There are several ways you can comment and uncomment a range of lines in vim editor. Commenting Method I (easiest) Step 1: Make sure your are in command mode by pressing Esc key Step2: Move your cusor to the start of the starting line of the block that you want to comment out press Ctrl + v for visual mode and now press the down arrow key to select till the last line you wanna comment. Step 3: Press upper case I (shift + i) and type # or // for commenting depending on the programming language. and finally press Esc key wait a sec and it's done! Read more »