Friday, November 26, 2010

Re: edit multiple files under multiple directories/folders

> The first thing that comes to my mind is using a macro. Open all the
> files ( vim tomcat*/**/server.xml ), record a macro in one file( see
> below ), and execute it for other files( :bufdo execute "@a" ). The
> sequence would be something like this:
>
> qa       - start recording and name it a
> gg       - make sure we are the start of file
> 30G     - go to line 30
> 4w       - move 4 words, this brings cursor to 8 of 8005
> 100C-a - increment the number by 100 ( note C-a is Control a)
> 94G     - the rest should be evident now
> 4w
> C-a
> 119G
> 4w
> 100C-a

I forgot a 'q' at the end (after 100 C-a).

However, I think improvising on Tim's solution would be the most
elegant way out.

--
Anurag Priyam,
3rd Year Undergraduate,
Department of Mechanical Engineering,
IIT Kharagpur.
+91-9775550642

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: