Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to replace a certain word across multiple files in vim, I've found that I'm able to do it if I open each file in a buffer, but when trying to open all of the files that need replacing vim declares that there are "too many file names". There's a plugin that enables what I need, but I was wondering if there's a solution that I'm unaware of that doesn't require a plugin.

share|improve this question
up vote 2 down vote accepted

You can always write your own script. Here is what I would do:

argadd file1
argadd file2
argadd file3 
argdo s/old/new/g

You need a new vim session for this though.

share|improve this answer
:argadd can handle multiple filename arguments, so you could do :argadd file1 file2 file3 – Heptite Sep 21 '12 at 3:30
Worked for me after some tinkering. Thanks. – CSED Sep 21 '12 at 3:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .