Arglist allows you to perform the same operation on multiple files, without having to have them preloaded in buffers first.
Arglist provides a few commands, as follows:
- :arg defines the arglist.
- :argdo allows you to execute a command on all the files in the arglist.
- :args displays the list of files in the arglist.
For example, if we wanted to replace all instances of animal in every Python file (recursively), we would do the following:
:arg **/*.py:argdo %s/\<animal\>/creature/ge | update
This command work as follows:
- :arg <pattern> adds a set of files matching a pattern to the arglist (each argument in arglist also has a corresponding buffer).
- **/*.py is a wildcard for every .py file, recursively ...