Mahendra Ladhe wrote:
> I've opened say 20 files using one vim instance. I want to
> do the same sequence of operations on all files as below.
> 1. Replace occurrences of one word by some other word 2..
> Save the file 3. Delete it from buffer so that some other
> file becomes current.
>
> Repeat above process till buffer becomes empty.
> Can I club all these actions at vim command line?
> something like
> :s/one_word/another_word/g;w;bd

A better approach is to NOT close each file (you probably want
to go back and admire each), so set option allowing you to have
multiple changed buffers:

  :set hidden

To substitute in all buffers:

  :bufdo %s/one_word/another_word/g

When finished (and want to exit all):

  :xa

John


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to