Re: vim question - comment multiple lines
From: Jason Dixon (jason_at_dixongroup.net)
Date: 09/10/03
- Previous message: Robert Canary: "Re: up2date -> SSL_connect error"
- In reply to: Herculano de Lima Einloft Neto: "vim question - comment multiple lines"
- Next in thread: Cameron Simpson: "Re: vim question - comment multiple lines"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Red Hat Mailing List <redhat-list@redhat.com> Date: 10 Sep 2003 00:31:18 -0400
On Tue, 2003-09-09 at 23: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.
(command mode)
# inserts "string1" at beginning of all lines
:1,$ s/^/string1/
# search/replace "string2" for "string1" at beginning of all lines
:1,$ s/^string1/string2/
# delete "string1" at the beginning of all lines
:1,$ s/^string1//
Here's a really good cheat***:
http://www.zippydesign.com/ying/linux/vi/index.html
If this doesn't work for you, please be more descriptive. HTH.
-- Jason Dixon, RHCE DixonGroup Consulting http://www.dixongroup.net -- redhat-list mailing list unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list
- Previous message: Robert Canary: "Re: up2date -> SSL_connect error"
- In reply to: Herculano de Lima Einloft Neto: "vim question - comment multiple lines"
- Next in thread: Cameron Simpson: "Re: vim question - comment multiple lines"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]