How to comment out a large block of lines in vi?
- Type Ctrl + V to enter VISUAL BLOCK mode
- Move up or down to select the lines you want to comment out
- Type :, it will show out :'<,'>
- Type at the end of line s/^/#/g
Press enter and that's all.