Two vi questions.
David I. Berg
dberg at cod.NOSC.MIL
Sun Sep 10 07:33:47 AEST 1989
In article <614 at jvncf.UUCP>, saroff at jvncf.UUCP (Steve Saroff lac00001) writes:
> 2) Is there any quick and dirty way of inserting a character(s) say
> at the front of lines (e.g. quick commenting out of 20 lines of code)
Note that the ^ character is a symbolic variable whose value is the null
position in front of the first character of each line (just like $ is the
symbolic variable whose value is the null position at the end of each line).
If you want to insert a # in front of every line in the file:
:%s/^/#/
If you want to comment out the next twenty lines from and including the
current line:
:.,+20s/^/#/
etc through all the variations on this theme.
--
David I. Berg (dberg at nosc.mil)
GENISYS Information Systems, Inc., 4250 Pacific Hwy #118, San Diego, CA 92110
MILNET: dberg at nosc.mil
UUCP: {akgua decvax dcdwest ucbvax}!sdcsvax!noscvax!dberg
More information about the Comp.unix.questions
mailing list