3.2. Control and Meta¶
Throughout this chapter, we will use C- to refer to the control key (CTRL) and M- to refer to the meta key. On most systems, ALT or ESC correspond to M-. On macOS, the Terminal application can be configured to use OPT (option) key as M-. If you are using macOS and have not setup OPT to work as meta, then follow the instructions here.
Modifier Key |
Name |
Usually |
---|---|---|
C- |
Control |
CTRL |
M- |
Meta |
ESC, ALT, or OPT |
Emacs commands are recognized by their key bindings, which is just a
fancy way of saying keyboard shortcuts. To use Emacs commands
effectively, you need to understand how to read their associated key
bindings so that you can successfully make the appropriate keystrokes.
In the table below, we’ll use KEY(key)
to denote that you should
press key while holding KEY and (key)
to denote that key
should be pressed without any kind of modifier key. For example,
CTRL(x, f)
means to hold CTRL, press x, then press f, then
release CTRL. An alternative would be CTRL(h), (t)
which means
to hold CTRL, press h, release CTRL, then press t.
Command |
Binding |
Alternative |
Keystrokes |
---|---|---|---|
Open/Find File |
C-x C-f |
C-xf |
|
Emacs tutorial |
C-h t |
|
If a binding has consecutive occurrences of either the C- or M- modifier keys, then there is no need to release the modifier key between those occurrences. This can be seen in the first example, where both of the following keystroke sequences result in C-x C-f:
CTRL(x), CTRL(f)
CTRL(x, f)
Rapid Fire Review
What does C- represent?
The Command key
The CTRL key
The META key
The SHIFT key
Which key typically corresponds to the Meta M- key on most systems?
The SHIFT key
The CTRL key
The ALT, ESC, or OPT key
The Command key
What are the corresponding keystrokes to execute the C-x h key binding? Note: This command highlights all text in the current Emacs buffer.
Hold CTRL, press x, then press h while holding CTRL
Press x, release, then press h while holding CTRL
Hold META, press x, then h
Hold CTRL, press x, release CTRL, then press h