Keys, keybindings, and how they work

Note: This article is part of my Emacs for Writers series, a complete tutorial on Emacs for non-programmers.


In this article, we’re going to grapple with the basics of Emacs keybindings. After reading this you should have a better understanding of of how these keybindings can speed up your workflow and help you use Emacs more efficiently.

In a text editor, particularly with a minimalist interface such as Emacs has, you will rely more on your keyboard than the mouse. In fact, this is the way most Emacs users prefer to work—with finger-twitch speed and accuracy. We shall not shun the mouse entirely, but you will be using it a whole lot less in Emacs than in other Word Processors.

Thus, instead of clicking and dragging, you will learn to rely on speedy keybindings—like keyboard shortcuts but Emacs shortcuts basically—to perform important functions for text manipulation. You may find that this approach is faster, more efficient, and works more naturally in tandem with how you think; this is why I often say Emacs is and integrated development environment (IDE) for your brain.

(If you’ve already been using Ctrl-c and Ctrl-v for copying and pasting, then you’re ahead of the game.)

At this point, I will pause my tutorial and advise you to check out the built-in Emacs tutorial that shipped with the program. You can access this by pressing Ctrl-h and then the “t” key on your keyboard. This will launch the Emacs visual tutorial. It does a great job of introducing you to the basic key commands for Emacs. For the sake of completeness, I will continue with my introduction to the keys and keybindings, but the built-in tutorial gives you everything you need to get started, and I suggest you work through that first.

Control, meta, and more

In the world of Emacs, the keys on your keyboard correspond with certain characters in the Emacs language and documentation.

C
the control key, corresponds to the Ctrl key on your keyboard.
M
the meta key, corresponds to the Alt key on your keyboard.
S
the shift key, corresponds to the Shift key on your keyboard.
s
(note the lower case) the super or “Windows” key, corresponds to the Windows or Mac key on your keyboard.

Except for the M, you probably could have guessed the others.

Keybindings, and how they work

The Emacs developers have already gone to the trouble of creating a map of keybindings that run certain important functions. Basically, this is the global keymap of Emacs, and it is vast.

As you can imagine, you have the power to change or complete rewrite the map as you see fit. Though, as a beginniner, you may want to stick with the default keys for now. But don’t let that discourage you. There are a lot of blank key commands available for you to configure as you like without overwriting an existing one.

As you can further imagine, many of the programs and functionality built into Emacs, or packages you will install along the way, have already rewritten much of the original keymap. This is fine, and it’s to be expected.

Here are some of the basic keybindings that will (most likely) not be overwritten by any other packages:

C-x C-s
Save buffer to file.
C-x C-f
Find file.

Notice, these keybindings involve pressing down the Ctrl key on your keyboard and pressing another key, but you don’t have to remove your finger from the Ctrl in order to punch the other characters. For example, to save the buffer, you can hold the Ctrl key and then type an “x” followed by an “s.” That’s it. No sweat.

As you peruse through the Emacs documentation (with C-h r) you will see many other key commands just like these. Now you will know what they mean.

Well done! You are ready to tackle more complicated problems, like moving around in a buffer.