vi editing

2010-01-15 Thread gahn
Hi gurus: I am trying to add a word on every line (right in front of every line) via vi. Right now I have: x x x after that, I want to have: new word x new word x new word x How could I do that with vi?

Re: vi editing

2010-01-15 Thread J.D. Bronson
preface each line: :%s/^/new word /g -- J.D. Bronson Information Technology Aurora Health Care - Milwaukee WI ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to

Re: vi editing

2010-01-15 Thread Boris Samorodov
On Fri, 15 Jan 2010 07:37:49 -0800 (PST) gahn wrote: I am trying to add a word on every line (right in front of every line) via vi. Right now I have: x x x Type this: :%s/^/new word / after that, I want to have: new word x new word x new word

Re: vi editing

2010-01-15 Thread Chad Perrin
On Fri, Jan 15, 2010 at 12:11:32PM -0600, J.D. Bronson wrote: preface each line: :%s/^/new word /g The trailing g isn't needed because you only need one substitution on each line. Thus: :%s/^/new word / -- Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]

Re: vi editing

2010-01-15 Thread Mike Clarke
On Friday 15 January 2010, gahn wrote: Hi gurus: I am trying to add a word on every line (right in front of every line) via vi. Right now I have: x x x after that, I want to have: new word x new word x new word x How could I do that

Re: vi editing

2010-01-15 Thread Giorgos Keramidas
On Fri, 15 Jan 2010 07:37:49 -0800 (PST), gahn ipfr...@yahoo.com wrote: Hi gurus: I am trying to add a word on every line (right in front of every line) via vi. Right now I have: x x x after that, I want to have: new word x new word x new word