Emacs Commands

You’re about to start learning some Emacs commands, so let’s discuss them a bit first. How do you give commands? Each command has a formal name, which (if you’re fastidious) is the name of a LISP routine inside of Emacs. These names are very long; you usually wouldn’t want to type the whole thing. So we need some way to abbreviate commands.

Emacs ties a command name to a short sequence of keystrokes starting with CTRL or ESC. This tying of commands to keystrokes is known as binding. In the case of the X Window System, Emacs binds some commands to mouse clicks (alone or modified by SHIFT or CTRL) and to options on menus.

The authors of Emacs tried to bind the most frequently used commands to the key sequences that are the easiest to reach. Here are the varieties of key sequences you’ll encounter:

  • The most commonly used commands (such as cursor movement commands) are bound to C- n (where n is any character). To press C- n, press and hold the CTRL key and type n, then release both keys.

  • Slightly less commonly used commands are bound to ESC n, where n is any character. To press ESC n, press the ESC key, release it, then type n. [7]

  • Other commonly used commands are bound to C-x something (C-x followed by something else—one or more characters or another control sequence). Among other types of commands, file manipulation commands, like the ones you are about to learn, are generally bound to C-x something.

  • Some specialized commands are bound to C-c something. These ...

Get Learning GNU Emacs, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.