Commenting block of code in VIM
- Ctrl + v : Visual block
- Select first column of the block of code to comment
- Shift + I : moves cursor to beginning and enters insert mode
- Type the character which comments the line: # for python or // for c/c++
- ESC
To uncomment use visual block (Ctrl + v) to select the commenting characters and delete them by typing x.