[Dub-pm] Tip of the day: Multi-line commenting

bobb bobb at redbrick.dcu.ie
Wed Apr 14 07:45:58 CDT 2004

Dave O Connor hath declared on Wednesday the 14 day of April 2004  :-:
> Here's an exercise for the reader (since my vim skillz suck): What's an easy
> way to prepend a hash to a block of selected text?

Strangely enough there are a number of ways... :)

You could mark the block in visual mode and then press colon ":" 
(while still in visual mode) The prompt will look like ( :'<,'> )
you can then put in a substitution of the beginning of a line with a hash,
( s/^/#/ ).

Another way is the use block-visual mode (ctl-v) in column zero,
Select the lines you want to comment, then use "I" to insert, press
hash then <esc>, and apparently I'm your mothers brother...

- bobb

Mr. Rogers could explain shoe-tying and make it seem like the coolest 
thing in the world. He was our Uncle and older brother. He told us we 
were special, and we knew he'd be there for us.
A cult leader, right down to the sneakers.

More information about the Dublin-pm mailing list