On 00:17 10 Sep 2003, Herculano de Lima Einloft Neto <[EMAIL PROTECTED]> 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.

For lines 10 to 20:

        :10,20s/^/foo /

Or you can just mark both lines (go to first line, type ka, go to last
line, type kb) and then:

        :'a,'bs/^/foo /

and so forth. Don't forget that vi has an entire line-mode editor (ex)
underneath it, accessible via the : key. See "man ex" and/or "man ed"
for more info on the line mode. It's very handy for stuff like this.
Ex is pretty much a complete superset of the ed editor.

And of course, once adept at using ed/ex, you're also much of the way to
being adept with the sed command...

Cheers,
-- 
Cameron Simpson <[EMAIL PROTECTED]> DoD#743
http://www.cskk.ezoshosting.com/cs/

Software engineering? That's like military intelligence, isn't it?
        - Doug Mohney <[EMAIL PROTECTED]>


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

Reply via email to