Here is a list of the completion commands defined in the minibuffer or the completions buffer when completion is available.
Complete the text in the minibuffer as much as possible; if unable to complete, display a list of possible completions.
Complete up to one word from the minibuffer text before point.
Complete the text in the minibuffer using minibuffer history.
Complete the text in the minibuffer using minibuffer defaults.
Submit the text in the minibuffer as the argument, possibly completing first. See Completion Exit.
Display a list of completions and a few useful key bindings
(minibuffer-completion-help).
Navigate through the list of completions.
While in the minibuffer, select the window showing the completion list.
In the completions buffer, choose the completion at point.
In the completions buffer, choose the completion at mouse click.
In the completions buffer, move to the following completion candidate.
In the completions buffer, move to the previous completion candidate.
In the completions buffer, navigate column-wise through the completion list.
In the completions buffer, navigate line-wise through the completion list.
Quit the completions window and switch to the minibuffer window.
Kill the completions buffer and delete the window showing it.
TAB (minibuffer-complete) is the most fundamental
completion command. It searches for all possible completions that
match the existing minibuffer text, and attempts to complete as much
as it can. See How Completion Alternatives Are Chosen, for how completion alternatives
are chosen.
SPC (minibuffer-complete-word) completes like
TAB, but only up to the next hyphen or space. If you have
‘auto-f’ in the minibuffer and type SPC, it finds that the
completion is ‘auto-fill-mode’, but it only inserts ‘ill-’,
giving ‘auto-fill-’. Another SPC at this point completes
all the way to ‘auto-fill-mode’. This command is not available for
arguments that often include spaces, such as file names.
If TAB or SPC is unable to complete, it displays in
another window a list of matching completion alternatives (if there are
any) and a few useful commands to select a completion candidate. You
can display the same completion list and help with ?
(minibuffer-completion-help). The following commands can be used
with the completion list:
While in the minibuffer or in the completion list buffer,
M-DOWN (minibuffer-next-completion) and
M-UP (minibuffer-previous-completion) navigate
through the completions displayed in the completions buffer. These
commands are sensitive to the completion list format: they move point
column-wise when the value of completions-format is
horizontal and line-wise when its value is vertical
(see Completion Options). If you set
minibuffer-completion-auto-choose to non-nil, using these
commands also inserts the current completion candidate into the
minibuffer. You can use M-RET
(minibuffer-choose-completion) or RET
(minibuffer-complete-and-exit) to choose the selected completion
candidate. By default, these commands exit the minibuffer, but with a
prefix argument (that is, C-u M-RET or C-u RET)
they insert the currently selected candidate into the minibuffer without
exiting it.
Typing M-v, while in the minibuffer, selects the window showing
the completion list (switch-to-completions). This paves the
way for using the commands below. PageUp, prior and
M-g M-c do the same. You can also select the window in other
ways (see Multiple Windows).
While in the completion list buffer, RET chooses the completion
candidate at point (choose-completion) and mouse-1 and
mouse-2 choose the completion at mouse click. With a prefix
argument, C-u RET inserts the completion at point into the
minibuffer, but doesn’t exit the minibuffer—thus, you can change your
mind and choose another candidate.
While in the completion list buffer, you can use TAB or
n to move point to the following completion candidate
(next-completion) and S-TAB or p to move point
to the previous completion alternative (previous-completion).
Like M-DOWN and M-UP, these commands are also
sensitive to the completion list format.
In contrast, RIGHT (next-column-completion) and
LEFT (previous-column-completion) always move point
column-wise, regardless of the completion list format. Likewise,
DOWN (next-line-completion) and UP
(previous-line-completion) always move point line-wise.
All of these movement commands (and also M-DOWN and M-UP) accept a numeric prefix argument n, which makes point move to the nth following or preceding completion candidate.
You can also complete using the history of minibuffer inputs for the
command which prompted you. C-x UP
(minibuffer-complete-history) works like TAB, but
completes using minibuffer history instead of the usual completion
candidates. A similar command C-x DOWN
(minibuffer-complete-defaults) completes using the default input
items provided by the prompting command.
Finally, q quits the window showing it and selects the window
showing the minibuffer (quit-window), and z kills the
completion buffer and delete the window showing it
(kill-current-buffer).
If the variable minibuffer-visible-completions is customized to
a non-nil value, it changes the commands bound to the arrow keys:
instead of moving in the minibuffer, they move between completion
candidates, like meta-arrow keys do by default (but note that, just as
when the window showing the completion list is selected, here too,
RIGHT and LEFT only move point column-wise and
DOWN and UP only move point line-wise,
regardless of the completion list format). Similarly, RET
selects the current candidate, like M-RET does normally.
C-g hides the completion window, but leaves the minibuffer
active, so you can continue typing at the prompt.