Tag Archives: :arg

Vim search and replace in multiple files

1. Open vim

2. Add files into argument list

3. Search and Replace

 

:argdo: Apply following commands to all the files

%s:  Search and replace all lines in the file

g: Change all occurences in each line

e: No error if the pattern is not found

c: need confirm to save changes

|: Separator between commands

update: Save (write file only if changes were made)