In Emacs, how are keystrokes denoted?

Emacs keystroke conventions are very different from the ones used by many other applications and sources of computing information. They also differ from the standards used in the great majority of Knowledge Base documents. However, because Emacs (and all of its documents) adheres rigorously to its own standard, Knowledge Base documents about Emacs observe the Emacs standard.

The Ctrl key

Emacs uses the C- prefix to denote holding down Ctrl while pressing another key. For example, holding down Ctrl and pressing x is denoted as Ctrl-x in the rest of the Knowledge Base, but as C-x in Knowledge Base documents about Emacs.

The Meta key

Because of Emacs' origin on Symbolics Lisp computers, it makes heavy use of a Meta key, denoted with the M- prefix. This key does not actually exist on most keyboards. In almost all configurations, however, pressing Esc once and releasing it is equivalent to holding down the Meta key. For example, to enter M-x, you would press Esc and release it, then press x.

A few obscure Emacs commands have an M-C- prefix. To handle these commands on most terminals, press and release Esc, then hold down Ctrl while pressing the final key in the command.

Note:
Many computers running the X Window System also have other equivalents for the Meta key. On some Linux systems, the Alt key may function as the Meta key. On most Sun keyboards, the diamond key functions as the Meta key.

Other common keys

Emacs also uses two- or three-letter abbreviations for many common keystrokes, as shown below:

Emacs Meaning Keystroke
BS Backspace
Backspace or C-h (terminal-dependent)
DEL Delete
Del or Backspace (terminal-dependent)
LFD Line Feed C-j
RET Carriage Return Return, Enter, or C-m
SPC Space Spacebar
TAB Tab Tab

Examples

Here are a few examples of how to interpret Emacs keystroke conventions:

Emacs command What you type
C-x C-c
Press and hold Ctrl, then press x, followed by c.
M-x shell
Press and release Esc, then press x. Then type shell and press Enter.
M-C-p
Press and release Esc, then press and hold Ctrl and press p.

At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?

This is document aghb in the Knowledge Base.
Last modified on 2016-11-30 12:31:18.

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.