[Novalug] vi question

William Sutton william at trilug.org
Sat Apr 11 16:52:24 EDT 2009


The following vim command should do the trick:

:%s/^\(\S\)/  \1/g

William Sutton

On Sat, 11 Apr 2009, 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
>



More information about the Novalug mailing list