Re: vim question - comment multiple lines

From: Cameron Simpson (cs_at_zip.com.au)
Date: 09/10/03

  • Next message: Jason Dixon: "Re: vim question - comment multiple lines"
    To: redhat-list@redhat.com
    Date: Wed, 10 Sep 2003 14:32:10 +1000
    
    

    On 00:17 10 Sep 2003, Herculano de Lima Einloft Neto <hlen@ig.com.br> 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 <cs@zip.com.au> DoD#743
    http://www.cskk.ezoshosting.com/cs/
    Software engineering? That's like military intelligence, isn't it?
            - Doug Mohney <sysmgr@king.eng.umd.edu>
    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Jason Dixon: "Re: vim question - comment multiple lines"