Srini's Point of View

My thoughts on technology, food and other fancies…

comment multiple lines in vi

The comment symbol for Unix scripts is typically “#”. You can use the same concept for files for other programming languages. My vi commands below use the “#” symbol.

If you want to comment 5 lines in a file -

  1. Go to the first line you want to comment
  2. Make sure you are ...

Copy and paste in Vi/Vim

This is a neat trick to know and saves a lot of time:

  1. Go to the beginning of the line where you want to start copying.
  2. Make sure you are in the command mode. (Hit ESC).
  3. Type “ma”. Which means, you are marking the spot with “a”.
  4. Go to the ...