A Curious Look at Emacs One Thousand Keybindings

By Xah Lee. Date: . Last updated: .

There are about 1353 keybinding in emacs by default. In this page, let's look at what they are. This is a curiosity take. Alone the way, you'll learn quite a bit about emacs history, and computing history. If you are looking for a practical list of emacs keys, see Emacs Keys Basics

List All Emacs Keys

(Alt+x describe-bindings to see the list on your machine)

Emacs began in 1976, so there's a lot history and keyboard history. While looking at emacs keys, it's helpful to look at lisp keyboards, which influenced emacs keys.

lisp-machine-keyboard-2-left
Symbolics's Lisp Machine keyboard PN 365407 Rev C. (Photo by Joey Devilla [https://www.globalnerdy.com/2009/02/05/hacklabtos-lisp-machine-keyboard/]. Used with permission.)
symbolics keyboard pn 365407 rev A f950b
Symbolics keyboard pn 365407 rev A [image source https://deskthority.net/keyboards-f2/the-lisp-keyboards-t98.html, by webwit]
lisp-machine-keyboard-4-right
Symbolics's Lisp Machine keyboard PN 365407 Rev C. (Photo by Joey Devilla [https://www.globalnerdy.com/2009/02/05/hacklabtos-lisp-machine-keyboard/]. Used with permission.)

[see Lisp Machine Keyboards]

Help, F1, C-h

All these are equivalent maps. (That is: F1 = Help = Ctrl+h)

C-h C-a		about-emacs
<f1> C-a	about-emacs
<help> C-a	about-emacs
<help> C-a   about-emacs
<help> C-c   describe-copying
<help> C-d   view-emacs-debugging
<help> C-e   view-external-packages
<help> C-f   view-emacs-FAQ
…
<help> i     info
<help> k     describe-key
<help> l     view-lossage
<help> m     describe-mode

The Help is a key on lisp keyboard, but also on many other keyboards. e.g.

C-x Prefix

There are 515 binding starting with the C-x notation.

The Ctrl+x etc is a generic prefix for frequently used commands that are useful globally. This one is most familiar to emacs users.

C-x C-@   pop-global-mark
C-x C-b   list-buffers
C-x C-c   save-buffers-kill-terminal
C-x C-d   list-directory
C-x C-e   eval-last-sexp
C-x C-f   find-file
C-x TAB   indent-rigidly
…
C-x $   set-selective-display
C-x '   expand-abbrev
C-x (   kmacro-start-macro
C-x )   kmacro-end-macro
C-x *   calc-dispatch
C-x +   balance-windows
C-x -   shrink-window-if-larger-than-buffer
C-x .   set-fill-prefix
C-x 0   delete-window
C-x 1   delete-other-windows
C-x 2   split-window-vertically
…
C-x a   Prefix Command
C-x b   switch-to-buffer
C-x d   dired
C-x e   kmacro-end-and-call-macro
C-x f   set-fill-column
C-x h   mark-whole-buffer
…
C-x <C-left>  previous-buffer
C-x <C-right> next-buffer
C-x <left>    previous-buffer
C-x <right>   next-buffer
C-x C-k C-a   kmacro-add-counter
C-x C-k C-c   kmacro-set-counter
C-x C-k C-d   kmacro-delete-ring-head
C-x C-k C-e   kmacro-edit-macro-repeat
C-x C-k C-f   kmacro-set-format
…

C-c

Another combo familiar to most emacs users starts with Ctrl+c. It is for mode-specific commands, not shown on this page because you need to be in a specific major mode.

C-x 8 for non-ASCII Character Input

There are 241 bindings starting with C-x 8

C-x 8 <   «
C-x 8 =   ¯
C-x 8 >   »
C-x 8 ?   ¿
C-x 8 C   ©
C-x 8 L   £
C-x 8 P   ¶
C-x 8 R   ®
C-x 8 S   §
C-x 8 Y   ¥
C-x 8 ^   Prefix Command

These are for inserting special non-ASCII characters. [see Emacs: Unicode Tutorial]

Ctrl+Meta Bindings (C-M)

There are 106 bindings starting with notation C-M-.

<C-M-down>   down-list
<C-M-end>    end-of-defun
<C-M-home>   beginning-of-defun
<C-M-left>   backward-sexp
<C-M-right>  forward-sexp
<C-M-up>     backward-up-list
C-M-@     mark-sexp
C-M-a     beginning-of-defun
C-M-b     backward-sexp
C-M-c     exit-recursive-edit
C-M-d     down-list
C-M-j     indent-new-comment-line
C-M-k     kill-sexp

These are designed to navigate/edit lisp code. [see Emacs: How to Edit Lisp Code]

Note the M- is the syntax for Meta key. It is a key on Lisp keyboards. Today, by default, GNU Emacs set Alt to type Meta.

Ctrl, Meta, Esc keys

Some of the Ctrl definitions is Ctrl with mouse button.

Alt Key

There are 231 bindings starting with the notation A-.

A-<             «
A-=             ¯
A->             »
A-?             ¿
A-C             ©
A-L             £
A-P             ¶
A-R             ®
A-S             §
A-Y             ¥

These are keybindings for the Alt key. This keybinding set is identical to Ctrl+x 8.

Note that GNU Emacs set Alt to type Meta by default, so these A- bindings have no effect. However, you can still type Alt by Ctrl+x @ a. ( Modifier Keys (Emacs Manual) ) Or, on Windows, set (setq w32-alt-is-meta nil). ( Windows Keyboard (Emacs Manual) )

Alt Mode is the SAIL (Stanford AI Lab) printing character that looks like a tall thin concave hollow diamond. On ASCII keyboards the Escape key maps to Alt Mode.

[from Devon Sean McCullough http://people.csail.mit.edu/devon/ ]

[see SAIL Keyboard]

sun type 6 keyboard meta compose altgraph keys
The Meta, Compose, AltGraph keys, on Sun Microsystem Type 6 Keyboard

[see Keyboard: What's the Difference Between Alt Graph Key, Compose Key, Dead Key?]

Dead Keys

Microsoft 4000 keyboard French dead key
Microsoft Natural Ergonomic Keyboard 4000, French version. The ^ and ¨ (to the right of P) are dead keys. (photo by [Alexander Sidorov https://plus.google.com/117062222142261173845/posts].)

There are 226 bindings with the notation of dead- in it. (gnu_emacs_keybinding_dead.txt) Example:

<S-dead-acute>        Prefix Command
<dead-acute>          Prefix Command
<S-dead-tilde>        A Ã
<S-dead-asciitilde>   A Ã
<dead-tilde>          A Ã
<S-dead-grave>        A À
<dead-grave>          A À
<S-dead-circumflex>   1 ¹
<S-dead-circum>       1 ¹
<S-dead-asciicircum>  1 ¹
<dead-circumflex>     1 ¹
<dead-circum>         1 ¹
<dead-asciicircum>    1 ¹
<S-dead-acute>        A Á
<dead-acute>          A Á
<S-dead-diaeresis>    A Ä
<dead-diaeresis>      A Ä

These are binding for Dead key for entering chars with Diacritic marks.

[see Keyboard: What's the Difference Between Alt Graph Key, Compose Key, Dead Key?]

[see Accent Marks: Trema, Umlaut, Macron, Circumflex]

Note that the S- is the notation for the Shift key. So, <S-dead-tilde> A would be Shift+dead ~+A.

(Thanks to Frédéric Perrin, Jason Rummey, Nei (http://anti.teamidiot.de/), for help.)

Mute Keys

There's also 70 keys with the notation of mute-, similar to the “dead” above. (gnu_emacs_keybinding_mute.txt) Not sure what they are.

Number Pad Keys

There are 56 bindings for the keys on the number pad. They have notation kp-. (gnu_emacs_keybinding_kp-.txt) Example:

<C-S-kp-1>  <C-S-end>
<C-S-kp-2>  <C-S-down>
<C-S-kp-3>  <C-S-next>
…
<M-kp-next> <M-next>
<S-kp-down> <S-down>
<S-kp-end>  <S-end>
<S-kp-home> <S-home>
<S-kp-left> <S-left>
<S-kp-next> <S-next>
…
<kp-0>    0
<kp-1>    1
<kp-2>    2
…
<kp-add>      +
<kp-decimal>  .
<kp-delete>   C-d
<kp-divide>   /
<kp-down>     <down>
<kp-end>      <end>

All these are key translations. They do not do anything special. For example, keypad 0 is the same as the 0 key on the main typing area. So, the code <kp-0> translates to 0. When NumLock is off, the 4 key on numpad is the key. So, the code <S-kp-left> (which means holding down Shift then pressing the on the numpad) simply translates to <S-left>.

Function keys, Home/End, Page Up/Down, Tab, etc Keys

Here's some special keys, such as {F1, Home, End, Tab, Enter, ❖ Window, ▤ Menu, PageUp, PageDown, etc}. (gnu_emacs_keybinding_function_keys.txt) Example:

<escape>	ESC

TAB		forward-button
<backtab>	backward-button
<backspace>	DEL
<return>	RET
<tab>		TAB

<home>		move-beginning-of-line
<end>		move-end-of-line
<insert>	overwrite-mode
<delete>	C-d

<prior>		scroll-down
<next>		scroll-up

<lwindow>	ignore
<rwindow>	ignore
<menu>		execute-extended-command

<right>		forward-char
<left>		backward-char
<up>		previous-line
<down>		next-line

<f3>		kmacro-start-macro-or-insert-counter
<f4>		kmacro-end-or-call-macro
<f10>		menu-bar-open
<f16>		clipboard-kill-ring-save
<f18>		clipboard-yank
<f20>		clipboard-kill-region

Note: Syntax such as {RET, TAB, DEL, ESC, etc}, are actual ASCII characters. While {<return>, <tab>, <delete>, <escape>, etc} are special keys.

Note the {<F16>, <F18>, <F20>}. Some keyboards have function keys up to 24 of them.

Mouse and Others

Here's the rest of the keys: gnu_emacs_keybinding_rest.txt

Mouse

<mouse-1>       mouse-set-point
<mouse-2>       help-follow-mouse
<mouse-3>       mouse-save-then-kill
<wheel-down>                    mwheel-scroll
<wheel-up>      mwheel-scroll
<mouse-movement>                ignore
<S-down-mouse-1>                mouse-appearance-menu
<S-mouse-3>     kmacro-end-call-mouse
<S-wheel-down>  mwheel-scroll
<S-wheel-up>    mwheel-scroll
<double-mouse-1>                mouse-set-point
<triple-mouse-1>                mouse-set-point
<down-mouse-1>  mouse-drag-region
<drag-mouse-1>  mouse-set-region
<drag-n-drop>   w32-drag-n-drop

Copy, Cut, Paste, etc Keys

<again>         repeat-complex-command
<redo>          repeat-complex-command
<undo>          undo
<copy>          clipboard-kill-ring-save
<cut>           clipboard-kill-region
<paste>         clipboard-yank
<execute>       execute-extended-command
<open>          find-file
<find>          search-forward

<begin>         beginning-of-buffer
<compose-last-chars>            compose-last-chars
<language-change>               ignore

<backtab>       backward-button
<S-insertchar>  yank
<delete-frame>  handle-delete-frame
<deletechar>    delete-char
<deleteline>    kill-line

Some of these keys can be seen on Sun Microsystem's keyboard. (alas, Sun just died a year ago (in 2010).)

sun type 6 keyboard left side
The special function keys for Copy, Paste, etc. Note that most of these keys have standard scancode in USB protocol. Some PC keyboards also have dedicated {Copy, Cut, Paste} keys in the 1990s, but it fell out of fashion. More photos: Sun Microsystem Type 6 Keyboard.

Other

<header-line>   Prefix Command
<iconify-frame>                 ignore-event
<insertchar>    overwrite-mode
<insertline>    open-line
<left-fringe>   Prefix Command
<make-frame-visible>            ignore-event
<mode-line>     Prefix Command
<right-fringe>  Prefix Command
<select-window>                 handle-select-window
<switch-frame>                  handle-switch-frame
<vertical-line>                 Prefix Command
<vertical-scroll-bar>           Prefix Command

<vertical-line> <down-mouse-1>  mouse-drag-vertical-line
<vertical-line> <mouse-1>       mouse-select-window

                                mouse-split-window-vertically
<vertical-scroll-bar> <mouse-1>
                                scroll-bar-toolkit-scroll

<header-line> <down-mouse-1>    mouse-drag-header-line
<header-line> <mouse-1>         mouse-select-window

<mode-line> <down-mouse-1>      mouse-drag-mode-line
<mode-line> <drag-mouse-1>      mouse-select-window
<mode-line> <mouse-1>           mouse-select-window
<mode-line> <mouse-2>           mouse-delete-other-windows
<mode-line> <mouse-3>           mouse-delete-window

These may not be actual keys. When emacs define actions for mouse or menu, it defines a pseudo-key with keyboard syntax. So <mode-line> <mouse-1> means clicking on the mode line. <vertical-scroll-bar> <mouse-1> means clicking on the scroll bar.

No Super and Hyper?

Curiously, there is no definition for Super s- and Hyper H- keys. These are the other prominent keys on lisp keyboard other than Meta M-. [see Emacs: How to define Super/Hyper Keys]

Emacs Keybinding