Categories

 

September 2010
M T W T F S S
« Aug    
 12345
6789101112
13141516171819
20212223242526
27282930  

What I'm Doing...

IMG00015.jpgIMG00017.jpgFallColors.jpgSpringFirst snow of the seasonTail Wind

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 -

Go to the first line you want to comment
Make sure you are in the command mode. [...]

  • Share/Bookmark

Copy and paste in Vi/Vim

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

Go to the beginning of the line where you want to start copying.
Make sure you are in the command mode. (Hit ESC).
Type “ma”. Which means, you are marking the spot with “a”.
Go to the line till where you want to copy.
type y`a (yank [...]

  • Share/Bookmark