Previous: VC Directory Buffer, Up: VC Directory Mode

28.1.9.2 VC Directory Commands

Emacs provides several commands for navigating the VC Directory buffer, and for “marking” files as belonging to the current VC fileset.

n
<SPC>
Move point to the next entry (vc-dir-next-line).
p
Move point to the previous entry (vc-dir-previous-line).
<TAB>
Move to the next directory entry (vc-dir-next-directory).
S-<TAB>
Move to the previous directory entry (vc-dir-previous-directory).
<RET>
f
Visit the file or directory listed on the current line (vc-dir-find-file).
o
Visit the file or directory on the current line, in a separate window (vc-dir-find-file-other-window).
m
Mark the file or directory on the current line (vc-dir-mark), putting it in the current VC fileset. If the region is active, mark all files in the region.

A file cannot be marked with this command if it is already in a marked directory, or one of its subdirectories. Similarly, a directory cannot be marked with this command if any file in its tree is marked.

M
If point is on a file entry, mark all files with the same status; if point is on a directory entry, mark all files in that directory tree (vc-dir-mark-all-files). With a prefix argument, mark all listed files and directories.
q
Quit the VC Directory buffer, and bury it (quit-window).
u
Unmark the file or directory on the current line. If the region is active, unmark all the files in the region (vc-dir-unmark).
U
If point is on a file entry, unmark all files with the same status; if point is on a directory entry, unmark all files in that directory tree (vc-dir-unmark-all-files). With a prefix argument, unmark all files and directories.
x
Hide files with ‘up-to-date’ status (vc-dir-hide-up-to-date).

While in the VC Directory buffer, all the files that you mark with m (vc-dir-mark) or M (vc-dir-mark) are in the current VC fileset. If you mark a directory entry with m, all the listed files in that directory tree are in the current VC fileset. The files and directories that belong to the current VC fileset are indicated with a ‘*’ character in the VC Directory buffer, next to their VC status. In this way, you can set up a multi-file VC fileset to be acted on by VC commands like C-x v v (see Basic VC Editing), C-x v = (see Old Revisions), and C-x v u (see VC Undo).

The VC Directory buffer also defines some single-key shortcuts for VC commands with the C-x v prefix: =, +, l, i, and v.

For example, you can commit a set of edited files by opening a VC Directory buffer, where the files are listed with the ‘edited’ status; marking the files; and typing v or C-x v v (vc-next-action). If the version control system is changeset-based, Emacs will commit the files in a single revision.

While in the VC Directory buffer, you can also perform search and replace on the current VC fileset, with the following commands:

S
Search the fileset (vc-dir-search).
Q
Do a regular expression query replace on the fileset (vc-dir-query-replace-regexp).
M-s a C-s
Do an incremental search on the fileset (vc-dir-isearch).
M-s a C-M-s
Do an incremental regular expression search on the fileset (vc-dir-isearch-regexp).

Apart from acting on multiple files, these commands behave much like their single-buffer counterparts (see Search).

The above commands are also available via the menu bar, and via a context menu invoked by Mouse-2. Furthermore, some VC backends use the menu to provide extra backend-specific commands. For example, Git and Bazaar allow you to manipulate stashes and shelves (where are a way to temporarily put aside uncommitted changes, and bring them back at a later time).