1

How many keyboard shortcuts are in Emacs?

I was looking at XKCD Comic 378:

XKCD Comic 378

So I'm wondering, how many keyboard shortcuts actually are there? How much of an exaggeration is this comic?

closed as too broad by Der Hochstapler Jun 13 '14 at 19:11

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    The comic is actually not about key bindings, but about commands. I heard an estimation somewhere that emacs comes with 10,000 defuns for text editing. But one normally learns only the ones of the mode needed, so it's not a problem. – Adobe Jun 25 '14 at 11:09
  • @Adobe Thanks. (I'm a Vim person myself ;) – Anubian Noob Jun 25 '14 at 23:08
  • There is simply no way to count them reliably. It's not hard to imagine that any editor worth professional usage will support adding shortcuts. – Sean Allred Jul 23 '14 at 22:50
3

Do M-x describe-bindings (or M-? b if its mapped) and count them.

It can differ depending on user settings, installed modules, etc.

Here are mine, there are 532 in my list (a few less if you don't count the "boring" ones at the beginning, like "backspace"):

Local Bindings:
key             binding
---             -------

linefeed    eval-print-last-sexp
C-j     eval-print-last-sexp
M-;     lisp-indent-for-comment
M-tab       lisp-complete-symbol
M-C-i       lisp-complete-symbol
M-C-q       indent-sexp
M-C-x       eval-defun

Global Bindings:
key             binding
---             -------

! .. ~      self-insert-command
€ .. ÿ      self-insert-command
again       repeat-complex-command
backspace   delete-backward-char
begin       beginning-of-line
button1     mouse-track
button1up   release-toolbar-button
button2     mouse-track
button3     popup-mode-menu
delete      backward-or-forward-delete-char
deletechar  delete-char
deleteline  kill-line
down        next-line
end     end-of-line
execute     execute-extended-command
f1      >
find        search-forward
help        help-for-help
home        beginning-of-line
insert      overwrite-mode
insertline  open-line
kp-0        self-insert-command
kp-1        self-insert-command
kp-2        self-insert-command
kp-3        self-insert-command
kp-4        self-insert-command
kp-5        self-insert-command
kp-6        self-insert-command
kp-7        self-insert-command
kp-8        self-insert-command
kp-9        self-insert-command
kp-add      self-insert-command
kp-decimal  self-insert-command
kp-delete   backward-or-forward-delete-char
kp-divide   self-insert-command
kp-down     next-line
kp-end      end-of-line
kp-enter    Kbd Macro: return
kp-equal    self-insert-command
kp-home     beginning-of-line
kp-insert   overwrite-mode
kp-left     backward-char-command
kp-multiply self-insert-command
kp-next     scroll-up-command
kp-prior    scroll-down-command
kp-right    forward-char-command
kp-separator    self-insert-command
kp-space    self-insert-command
kp-subtract self-insert-command
kp-tab      Kbd Macro: tab
kp-up       previous-line
left        backward-char-command
menu        popup-mode-menu
next        scroll-up-command
prior       scroll-down-command
redo        repeat-complex-command
return      newline
right       forward-char-command
space       self-insert-command
tab     indent-for-tab-command
undo        undo
up      previous-line
C-      set-mark-command
C--     negative-argument
C-/     undo
C-0 .. C-9  digit-argument
C-     mark-end-of-buffer
C-@     set-mark-command
C-T     transpose-line-down
C-]     abort-recursive-edit
C-_     undo
C-a     beginning-of-line
C-b     backward-char-command
C-c     >
C-d     delete-char
C-e     end-of-line
C-f     forward-char-command
C-g     keyboard-quit
C-h     >
C-i     indent-for-tab-command
C-k     kill-line
C-l     recenter
C-m     newline
C-n     next-line
C-o     open-line
C-p     previous-line
C-q     quoted-insert
C-r     isearch-backward
C-s     isearch-forward
C-t     transpose-chars
C-u     universal-argument
C-v     scroll-up-command
C-w     kill-region
C-x     >
C-y     yank
C-z     suspend-emacs-or-iconify-frame
C-begin     beginning-of-buffer
C-button1   mouse-track-insert
C-delete    delete-primary-selection
C-down      forward-block-of-lines
C-end       end-of-buffer
C-home      beginning-of-buffer
C-insert    copy-primary-selection
C-kp-down   forward-block-of-lines
C-kp-end    end-of-buffer
C-kp-home   beginning-of-buffer
C-kp-left   backward-word
C-kp-next   scroll-left
C-kp-prior  scroll-right
C-kp-right  forward-word
C-kp-up     backward-block-of-lines
C-left      backward-word
C-next      scroll-left
C-prior     scroll-right
C-right     forward-word
C-space     set-mark-command
C-tab       other-window
C-up        backward-block-of-lines
M-!     shell-command
M-#     calc-dispatch
M-$     ispell-word
M-%     query-replace
M-'     abbrev-prefix-mark
M-(     insert-parentheses
M-)     move-past-close-and-reindent
M-*     pop-tag-mark
M-,     tags-loop-continue
M--     negative-argument
M-.     find-tag
M-/     dabbrev-expand
M-0 .. M-9  digit-argument
M-:     eval-expression
M-     end-of-buffer
M-?     >
M-@     mark-word
M-T     transpose-line-up
M-V     scroll-other-window-down
M-\     delete-horizontal-space
M-^     delete-indentation
M-a     backward-sentence
M-b     backward-word
M-c     capitalize-region-or-word
M-d     kill-word
M-e     forward-sentence
M-f     forward-word
M-g     goto-line
M-h     mark-paragraph
M-i     tab-to-tab-stop
M-j     indent-new-comment-line
M-k     kill-sentence
M-l     downcase-region-or-word
M-m     back-to-indentation
M-q     fill-paragraph-or-region
M-r     move-to-window-line
M-t     transpose-words
M-u     upcase-region-or-word
M-v     scroll-down-command
M-w     kill-ring-save
M-x     execute-extended-command
M-y     yank-pop
M-z     zap-to-char
M-{     backward-paragraph
M-|     shell-command-on-region
M-}     forward-paragraph
M-~     not-modified
M-backspace backward-kill-word
M-button1   mouse-track-do-rectangle
M-delete    backward-or-forward-kill-word
M-down      forward-paragraph
M-end       end-of-buffer-other-window
M-escape    >
M-f4        save-buffers-kill-emacs
M-home      beginning-of-buffer-other-window
M-kp-delete backward-or-forward-kill-word
M-kp-down   forward-paragraph
M-kp-end    end-of-buffer-other-window
M-kp-home   beginning-of-buffer-other-window
M-kp-left   backward-sexp
M-kp-next   scroll-other-window
M-kp-prior  scroll-other-window-down
M-kp-right  forward-sexp
M-kp-up     backward-paragraph
M-left      backward-sexp
M-linefeed  indent-new-comment-line
M-next      scroll-other-window
M-prior     scroll-other-window-down
M-right     forward-sexp
M-space     just-one-space
M-up        backward-paragraph
M-C-%       query-replace-regexp
M-C--       negative-argument
M-C-/       dabbrev-completion
M-C-0 .. M-C-9   digit-argument
M-C-@       mark-sexp
M-C-[       >
M-C-\       indent-region
M-C-a       beginning-of-defun
M-C-b       backward-sexp
M-C-c       exit-recursive-edit
M-C-d       down-list
M-C-e       end-of-defun
M-C-f       forward-sexp
M-C-h       mark-defun
M-C-j       indent-new-comment-line
M-C-k       kill-sexp
M-C-l       switch-to-other-buffer
M-C-n       forward-list
M-C-o       split-line
M-C-p       backward-list
M-C-r       isearch-backward-regexp
M-C-s       isearch-forward-regexp
M-C-t       transpose-sexps
M-C-u       backward-up-list
M-C-v       scroll-other-window
M-C-w       append-next-kill
M-C-z       activate-region
M-C-backspace   backward-kill-sexp
M-C-button3 popup-buffer-menu
M-C-delete  backward-or-forward-kill-sexp
M-C-down    scroll-up-one
M-C-end     end-of-defun
M-C-home    beginning-of-defun
M-C-kp-delete   backward-or-forward-kill-sexp
M-C-kp-down scroll-up-one
M-C-kp-end  end-of-defun
M-C-kp-home beginning-of-defun
M-C-kp-left backward-sentence
M-C-kp-next forward-page
M-C-kp-prior    backward-page
M-C-kp-right    forward-sentence
M-C-kp-up   scroll-down-one
M-C-left    backward-sentence
M-C-next    forward-page
M-C-prior   backward-page
M-C-right   forward-sentence
M-C-space   mark-sexp
M-C-up      scroll-down-one
Sh-button1  mouse-track-adjust
Sh-delete   kill-primary-selection
Sh-insert   yank-clipboard-selection
Sh-tab      tab-to-tab-stop
C-Sh-button1    mouse-track-delete-and-insert
C-Sh-tab    backward-other-window

M-C-[ :     eval-expression
M-C-[ escape    keyboard-escape-quit
M-C-[ C-[   keyboard-escape-quit

M-? ?       help-for-help
M-? A       command-apropos
M-? B       describe-beta
M-? C       customize
M-? F       xemacs-local-faq
M-? a       hyper-apropos
M-? b       describe-bindings
M-? c       describe-key-briefly
M-? d       describe-function
M-? e       describe-last-error
M-? f       describe-function
M-? i       info
M-? k       describe-key
M-? l       view-lossage
M-? m       describe-mode
M-? n       view-emacs-news
M-? p       finder-by-keyword
M-? q       help-quit
M-? s       describe-syntax
M-? t       help-with-tutorial
M-? v       describe-variable
M-? w       where-is
M-? f1      help-for-help
M-? help    help-for-help
M-? return  manual-entry
M-? C-c     Info-goto-emacs-command-node
M-? C-d     describe-distribution
M-? C-f     Info-elisp-ref
M-? C-h     help-for-help
M-? C-i     Info-query
M-? C-k     Info-goto-emacs-key-command-node
M-? C-l     describe-copying
M-? C-m     manual-entry
M-? C-n     view-emacs-news
M-? C-p     describe-pointer
M-? C-w     describe-no-warranty

M-escape :  eval-expression
M-escape escape   keyboard-escape-quit
M-escape C-[    keyboard-escape-quit

C-c !       >
C-c M-h     pydoc-commands

C-h ?       help-for-help
C-h A       command-apropos
C-h B       describe-beta
C-h C       customize
C-h F       xemacs-local-faq
C-h a       hyper-apropos
C-h b       describe-bindings
C-h c       describe-key-briefly
C-h d       describe-function
C-h e       describe-last-error
C-h f       describe-function
C-h i       info
C-h k       describe-key
C-h l       view-lossage
C-h m       describe-mode
C-h n       view-emacs-news
C-h p       finder-by-keyword
C-h q       help-quit
C-h s       describe-syntax
C-h t       help-with-tutorial
C-h v       describe-variable
C-h w       where-is
C-h f1      help-for-help
C-h help    help-for-help
C-h return  manual-entry
C-h C-c     Info-goto-emacs-command-node
C-h C-d     describe-distribution
C-h C-f     Info-elisp-ref
C-h C-h     help-for-help
C-h C-i     Info-query
C-h C-k     Info-goto-emacs-key-command-node
C-h C-l     describe-copying
C-h C-m     manual-entry
C-h C-n     view-emacs-news
C-h C-p     describe-pointer
C-h C-w     describe-no-warranty

C-x $       set-selective-display
C-x '       expand-abbrev
C-x (       start-kbd-macro
C-x )       end-kbd-macro
C-x +       balance-windows
C-x -       shrink-window-if-larger-than-buffer
C-x .       set-fill-prefix
C-x /       point-to-register
C-x 0       delete-window
C-x 1       delete-other-windows
C-x 2       split-window-vertically
C-x 3       split-window-horizontally
C-x 4       >
C-x 5       >
C-x 6       window-configuration-to-register
C-x ;       set-comment-column
C-x        scroll-right
C-x F       >
C-x K       find-function-on-key
C-x V       find-variable
C-x [       backward-page
C-x ]       forward-page
C-x ^       enlarge-window
C-x `       next-error
C-x a       >
C-x b       switch-to-buffer
C-x d       dired
C-x e       call-last-kbd-macro
C-x f       set-fill-column
C-x g       insert-register
C-x h       mark-whole-buffer
C-x i       insert-file
C-x j       jump-to-register
C-x k       kill-buffer
C-x l       count-lines-page
C-x m       compose-mail
C-x n       >
C-x o       other-window
C-x q       kbd-macro-query
C-x r       >
C-x s       save-some-buffers
C-x u       advertised-undo
C-x x       copy-to-register
C-x {       shrink-window-horizontally
C-x }       enlarge-window-horizontally
C-x backspace   backward-kill-sentence
C-x delete  backward-or-forward-kill-sentence
C-x kp-delete   backward-or-forward-kill-sentence
C-x linefeed    dired-jump-back
C-x return  >
C-x tab     indent-rigidly
C-x C-      pop-global-mark
C-x C-@     pop-global-mark
C-x C-b     list-buffers
C-x C-c     save-buffers-kill-emacs
C-x C-d     list-directory
C-x C-e     eval-last-sexp
C-x C-f     find-file
C-x C-i     indent-rigidly
C-x C-j     dired-jump-back
C-x C-k     edit-kbd-macro
C-x C-l     downcase-region
C-x C-m     >
C-x C-o     delete-blank-lines
C-x C-p     mark-page
C-x C-q     toggle-read-only
C-x C-r     find-file-read-only
C-x C-s     save-buffer
C-x C-t     transpose-lines
C-x C-u     upcase-region
C-x C-v     find-alternate-file
C-x C-w     write-file
C-x C-x     exchange-point-and-mark
C-x C-z     suspend-or-iconify-emacs
C-x C-space pop-global-mark
C-x M-:     repeat-complex-command
C-x M-escape    repeat-complex-command
C-x M-C-[   repeat-complex-command

f1 ?        help-for-help
f1 A        command-apropos
f1 B        describe-beta
f1 C        customize
f1 F        xemacs-local-faq
f1 a        hyper-apropos
f1 b        describe-bindings
f1 c        describe-key-briefly
f1 d        describe-function
f1 e        describe-last-error
f1 f        describe-function
f1 i        info
f1 k        describe-key
f1 l        view-lossage
f1 m        describe-mode
f1 n        view-emacs-news
f1 p        finder-by-keyword
f1 q        help-quit
f1 s        describe-syntax
f1 t        help-with-tutorial
f1 v        describe-variable
f1 w        where-is
f1 f1       help-for-help
f1 help     help-for-help
f1 return   manual-entry
f1 C-c      Info-goto-emacs-command-node
f1 C-d      describe-distribution
f1 C-f      Info-elisp-ref
f1 C-h      help-for-help
f1 C-i      Info-query
f1 C-k      Info-goto-emacs-key-command-node
f1 C-l      describe-copying
f1 C-m      manual-entry
f1 C-n      view-emacs-news
f1 C-p      describe-pointer
f1 C-w      describe-no-warranty

C-c ! a     Footnote-add-footnote
C-c ! b     Footnote-back-to-message
C-c ! c     Footnote-cycle-style
C-c ! d     Footnote-delete-footnote
C-c ! g     Footnote-goto-footnote
C-c ! r     Footnote-renumber-footnotes
C-c ! s     Footnote-set-style

C-x 4 .     find-tag-other-window
C-x 4 0     kill-buffer-and-window
C-x 4 F     find-function-other-window
C-x 4 V     find-variable-other-window
C-x 4 a     add-change-log-entry-other-window
C-x 4 b     switch-to-buffer-other-window
C-x 4 d     dired-other-window
C-x 4 f     find-file-other-window
C-x 4 l     find-library-other-window
C-x 4 m     compose-mail-other-window
C-x 4 r     find-file-read-only-other-window
C-x 4 linefeed   dired-jump-back-other-window
C-x 4 C-f   find-file-other-window
C-x 4 C-j   dired-jump-back-other-window
C-x 4 C-o   display-buffer

C-x 5 0     delete-frame
C-x 5 2     make-frame
C-x 5 F     find-function-other-frame
C-x 5 V     find-variable-other-frame
C-x 5 b     switch-to-buffer-other-frame
C-x 5 d     dired-other-frame
C-x 5 f     find-file-other-frame
C-x 5 l     find-library-other-frame
C-x 5 m     compose-mail-other-frame
C-x 5 o     other-frame
C-x 5 r     find-file-read-only-other-frame
C-x 5 linefeed   dired-jump-back-other-frame
C-x 5 C-f   find-file-other-frame
C-x 5 C-j   dired-jump-back-other-frame

C-x F o     facemenu-set-face

C-x a '     expand-abbrev
C-x a +     add-mode-abbrev
C-x a -     inverse-add-global-abbrev
C-x a e     expand-abbrev
C-x a g     add-global-abbrev
C-x a i     >
C-x a l     add-mode-abbrev
C-x a C-a   add-mode-abbrev

C-x n d     narrow-to-defun
C-x n n     narrow-to-region
C-x n p     narrow-to-page
C-x n w     widen

C-x r +     increment-register
C-x r b     bookmark-jump
C-x r c     clear-rectangle
C-x r d     delete-rectangle
C-x r g     insert-register
C-x r i     insert-register
C-x r j     jump-to-register
C-x r k     kill-rectangle
C-x r l     bookmark-bmenu-list
C-x r m     bookmark-set
C-x r n     number-to-register
C-x r o     open-rectangle
C-x r p     replace-rectangle
C-x r r     copy-rectangle-to-register
C-x r s     copy-to-register
C-x r t     string-rectangle
C-x r w     window-configuration-to-register
C-x r x     copy-to-register
C-x r y     yank-rectangle
C-x r space point-to-register
C-x r C-@   point-to-register
C-x r C-space   point-to-register

C-x C-m F   set-default-buffer-file-coding-system
C-x C-m c   universal-coding-system-argument
C-x C-m f   set-buffer-file-coding-system
C-x C-m p   set-buffer-process-coding-system
C-x C-m t   set-terminal-coding-system

C-x return F    set-default-buffer-file-coding-system
C-x return c    universal-coding-system-argument
C-x return f    set-buffer-file-coding-system
C-x return p    set-buffer-process-coding-system
C-x return t    set-terminal-coding-system

C-x a i g   inverse-add-global-abbrev
C-x a i l   inverse-add-mode-abbrev

Also note that M-x ... allows you to execute any command, even if it is not bounds, so I suppose you could count those as "keyboard shortcuts" of sorts.

  • Is this all them? – Anubian Noob Jun 13 '14 at 19:10
  • @AnubianNoob M-x describe-bindings spits out all the bindings that XEmacs knows about, so yes, for my installation, this is all of them. Yours may be different. Try it. – Jason C Jun 13 '14 at 19:19
  • 1
    @AnubianNoob These may be all of them for some particular "mode" (e.g. c++-mode, latex-mode, org-mode, whatever the type of file you're editing). If you switch to a different mode (e.g. open a different kind of file), a different set of keybindings will be activated. And of course you can add your own keybindings, as most users do. – ShreevatsaR Jan 10 '16 at 17:21
  • @AnubianNoob Besides that these are only for the particular mode it excludes keys bound to self-insert eg if you press the "a" keys it will normall insert an "a", that's a keybindding too (which can be bound to something else, which it is in some special modes). – skyking Mar 28 '18 at 11:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.