[Novalug] vi question
Jon LaBadie
novalugml at jgcomp.com
Sat Apr 11 23:11:26 EDT 2009
On Sun, Apr 12, 2009 at 09:04:06AM +1200, Mark Smith wrote:
> :v,^$,s,^, ,
>
> v - for each line that does NOT match the following pattern do the following command
> (see 'g' for the does match case)
>
> s - substitute
>
Just for balance, the global cmd would be usable too:
: g/./s/^/ /
> On Sat, Apr 11, 2009 at 04:37:07PM -0400, Charles M Howe wrote:
> > List,
> >
> > I have a fairly length text file that I created using vi. It consists of
> > data, one line, then, usually but not always a blank line. I wish to add
> > two spaces at the beginning of eac line, but I would prefer not to put
> > them in the blank lines. How can I do this? Fwiw, I have a copy of
> > "Linux in a Nutshell", 5th edition, which has a chapter on vi. (If you
> > can tell me what page the info is on, that would be a bonus.)
> >
> > Charlie
> >
> >
> > _______________________________________________
> > Novalug mailing list
> > Novalug at calypso.tux.org
> > http://calypso.tux.org/cgi-bin/mailman/listinfo/novalug
>
> --
> Mark Smith
> mark at winksmith.com
> mark at tux.org
> _______________________________________________
> Novalug mailing list
> Novalug at calypso.tux.org
> http://calypso.tux.org/cgi-bin/mailman/listinfo/novalug
>
>>> End of included message <<<
--
Jon H. LaBadie jon at jgcomp.com
JG Computing
12027 Creekbend Drive (703) 787-0884
Reston, VA 20194 (703) 787-0922 (fax)
More information about the Novalug
mailing list