If you have to insert comment on several lines do you do manually insert the comment character in every line? Stop. Vim is a really good editor and has a nice feature to accomplish this quickly. Here are the steps:
- Enter visual blocking mode by pressing CTRL V (CTRL key and the lowercase v).
- Make your selection using motion keys(jklm, etc).
- Press I(uppercase I) to enter block insert mode.
- Press #, the comment character.
- Press Esc key. The comment character # will be inserted on each line the visual block selection.