October 2015
Intermediate to advanced
356 pages
7h 54m
English
| Tip 38 | Group Buffers into a Collection with the Argument List |
The argument list is easily managed and can be useful for grouping together a collection of files for easy navigation. We can run an Ex command on each item in the argument list using the :argdo command.
Let’s start by opening a handful of files in Vim:
| => | $ cd code/files/letters |
| => | $ vim *.txt |
| <= | 5 files to edit |
In Tip 37, we saw that the :ls command provides a listing of buffers. Now let’s examine the argument list:
| => | :args |
| <= | [a.txt] b.txt c.txt. d.txt e.txt |
The argument list represents the list of files that was passed as an argument when we ran the vim command. In our case, we provided a single argument, *.txt, but our shell expanded the * wildcard, matching the ...