Search and replace in Vim across all the project files

The other big option here is simply not to use vim:

sed -i 's/pattern/replacement/' <files>

or if you have some way of generating a list of files, perhaps something like this:

find . -name *.cpp | xargs sed -i 's/pattern/replacement/'
grep -rl 'pattern1' | xargs sed -i 's/pattern2/replacement/'

and so on!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)