Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Advice on coding in VI ?


This one time, at band camp, Grant Parnell wrote:
>Delete up until matching line. 
>==============================
>You've found the need to delete a chunk of stuff, mark the beginning with
>some unique code word (I use 'gloop' for instance) skim through till the
>end and do "d?gloop" to delete backwards until a line with gloop is found.

You can save yourself some effort (this works with vim, I don't know if it's
100% vi) by marking a position with "'a" (set mark 'a') in command mode,
then go to the end and just "d'a" (delete to mark 'a').

"d$" is also very handy for deleting to the end of a line, and I find "Go"
useful for editing conffiles over slow links (go to the end of the file,
then start inserting on a new line)

-- 
jaq@xxxxxxxxxxxxxx                           http://spacepants.org/jaq.gpg
 
Weaseling out of things is important to learn.  It's what seperates us
from the animals.  Except the weasel.
        -- Homer Simpson, Boy-Scoutz In The Hood