[ILUG] vi tip...
feargal at helgrim.com
Fri Apr 16 13:11:20 IST 2004
On Thu, 15 Apr 2004 11:26:33 +0100
kevin lyda <kevin+dated+1082456802.8afea6 at ie.suberic.net> wrote:
> for vi users who don't know about recording...
> ok, for years i'd accidentally type q and then there'd be this annoying
> "recording" thing in the bottom left. so i finally went and figured out
> how to use it. let's say you have this file:
Yeah, the other really powerful thing about this is you can use it to make the same change to lots of similar file. For example, if you've got 1000 odd DNS zone files, and you need to change all the MX records from smtp.example.com to smtp.example.net, you can do something like
vim `grep -l smtp.example.com *`
Then record the actions, and also record the :w and :n to move to the next file. Then you just have to type 1000 at a and enjoy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 187 bytes
Desc: not available
Url : http://mail.linux.ie/pipermail/ilug/attachments/20040416/10b0d09e/attachment.pgp
More information about the ILUG