Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 1 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.