On 21 nov, 00:14, Kyle Lippincott <[email protected]> wrote:
> :set autowrite
> :args **/*.txt
> :argdo s/from/to/g
>
> I think will do what you wish; if not exact syntax (I typed it from memory),

Right, except you probably want:

  :argdo %s/from/to/g

To replace in the entire file (note the %).

The variants I use are the following:

  " this one to replace across all buffers, confirming each
replacement
  :bufdo %s/pattern/substituion/gce | update

And:

  " same, confirming each replacement
  :args **/*.txt
  :argdo %s/pattern/substitution/gce | update

Note the "update" means you don't need to set autowrite first, and the
"e" flag suppresses errors for any files which don't contain the
search pattern.

Based on:

  http://vim.wikia.com/wiki/VimTip1512

Cheers,
Wincent

-- 
You received this message from the "vim_mac" 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

Reply via email to