# The Emacs Guru Guide to Key Bindings

DevFeed: [The Emacs Guru Guide to Key Bindings](<https://devfeed.tech/articles/the-emacs-guru-guide-to-key-bindings-22020.md>)

Original publisher: [Read original article](<http://www.wilfred.me.uk/blog/2018/01/06/the-emacs-guru-guide-to-key-bindings/>)

Author: Wilfred Hughes

Published: 2018-01-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [Wilfred Hughes](<https://devfeed.tech/sources/wilfred-hughes.md>)

Topics: [Emacs](<https://devfeed.tech/topics/emacs.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>)

Tags: [beginners](<https://devfeed.tech/tags/beginners.md>), [commands](<https://devfeed.tech/tags/commands.md>), [emacs](<https://devfeed.tech/tags/emacs.md>), [guide](<https://devfeed.tech/tags/guide.md>), [mnemonic](<https://devfeed.tech/tags/mnemonic.md>), [shortcuts](<https://devfeed.tech/tags/shortcuts.md>)

## AI overview

This tutorial explains the logic behind Emacs key bindings. It covers mnemonic bindings, consistent patterns for movement and text operations, and ways to discover which commands and shortcuts are active.

## Source excerpt

Imagine that you hold Control and type your name into Emacs. Can you describe what will happen? - The 'Emacs Guru Test' Emacs shortcuts (known as 'key bindings') can seem ridiculous to beginners. Some Emacs users even argue you should change them as soon as you start using Emacs. They are wrong. In this post, I'll describe the logic behind the Emacs key bindings. Not only will you be closer to passing the guru test, but you might even find you like some of the defaults! There Are How Many? Emacs has a ton of key bindings. ELISP> (length global-map) 143 Emacs is a modal editor, so most key bindings are mode-specific. However, my current Emacs instance has well over a hundred global shortcuts that work everywhere. (Keymaps are nested data structures, so this actually undercounts! For example, C-h C-h and C-h f are not counted separately.) Even that is a drop in the bucket compared with how many commands we could define key bindings for. ELISP> (let ((total 0)) (mapatoms (lambda (sym) (when (commandp sym) (setq total (1+ total))))) total) 8612 How can we possibly organise all these commands? Mnemonic Key Bindings Basic commands are often given key bindings based on their name. You'll encounter all of these important commands in the Emacs tutorial. Command Key Binding eXecute-extended-command M-x Next-line C-n Previous-line C-p Forward-char C-f Backward-car C-b iSearch-forward C-s Mnemonics are a really effective way of memorising things. If you can remember the name of the command, you can probably remember the key binding too. Organised Key Bindings Many Emacs movement commands are laid out in a consistent pattern. For example, movement by certain amount: Command Key Binding forward-char C-f forward-word M-f forward-sexp C-M-f Moving to the end of something: Command Key Binding move-end-of-line C-e forward-sentence M-e end-of-defun C-M-e Transposing, which swaps text either side of the cursor: Command Key Binding transpose-chars C-t transpose-words M-t transpose-sexps