I think you can also use
 
:%s/^/(your text)/g
 
regular _expression_ which will put the text at the begining.
 
-shishir

MKlinke <[EMAIL PROTECTED]> wrote:
On Wednesday 10 September 2003 12:48, Bret Hughes wrote:
> On Tue, 2003-09-09 at 23:55, MKlinke wrote:
> > On Tuesday 09 September 2003 22:17, Herculano de Lima Einloft Neto
> >
> > wrote:
> > > I guess this is an easy one.. how can I insert / delete
> > > something at the beggining of each line of a block in vi? Still
> > > can't figure it, though there must be at least ten ways.
> > >
> > > Thanks in advance
> >
> > 1 of 10 ...
> >
> > Place cursor at the beginning of the first line you want to change.
> > Press v
> > Move the cursor down to the last line you want to change.
> > Press I (The capital letter after H and before J)
> > Type in the text you wish to insert
> > Press
> >> > Now all lines selected should show the inserted text.
>
> This is cool. I was aware of marking and using the marks in ranges
> but and I knew about using visual mode to select text to be yanked or
> deleted. I did not know about ctrl-v - visual block mode Insert
> mode.
>
> Thanks,
>
> Bret

There's also a 'c'/'C' change mode, 'a' append mode, '~'/'u'/'U'
switchcase modes and, heh, well you get the idea ... They're listed in
the ':help' (sect 10.5 Visual Block Mode).

Regards, Mike Klinke


--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Reply via email to