For over four decades, Emacs has stood as a pillar in the text editing world, beloved by programmers, writers, and power users alike. What makes Emacs particularly powerful is its extensive keyboard shortcut system that allows users to perform complex operations without ever touching the mouse.

Emacs comes with an excellent built-in tutorial that can be accessed with C-h t (Control-h followed by t). I highly recommend all new users complete this tutorial to get comfortable with Emacs’ fundamentals. That said, the tutorial is comprehensive and takes time to complete.

hotkeys

This guide serves as a TL;DR and quick reference of the most essential hotkeys you should memorize. Consider it a short recap of what’s worth knowing by heart to be immediately productive in Emacs, whether you’re new to the editor or just need a refresher.

Understanding Emacs Notation

Before diving into the hotkeys themselves, let’s decode how to read Emacs key notation:

  • C- represents the Control key. For example, C-a means “hold Control and press a”.
  • M- represents the Meta key, which on modern keyboards is typically the Alt key. So M-f means “hold Alt and press f”.
  • C-x followed by another key represents a two-key sequence. Press Control and x together, release, then press the next key.
  • M-x similarly starts a command sequence where you type the command name after pressing Alt and x.

Multiple modifier keys can be combined. For example, C-M-f means holding both Control and Alt while pressing f.

With this foundation, let’s explore the essential hotkeys that will dramatically improve your Emacs efficiency.

Essential Emacs Hotkeys by Category

Text Navigation

Efficient text navigation is the foundation of productive editing. These shortcuts let you move through your document with precision:

HotkeyAction Description
C-aMove to beginning of line
C-eMove to end of line
C-fMove forward one character
C-bMove backward one character
M-fMove forward one word
M-bMove backward one word
C-nMove to next line
C-pMove to previous line
C-vPage down
M-vPage up
M-<Move to beginning of buffer
M->Move to end of buffer
C-lRecenter buffer around cursor

The navigation keys follow a pattern: f for forward, b for backward, p for previous, and n for next. Once you internalize these patterns, they become second nature.

Text Editing

These shortcuts handle the core editing operations that you’ll use hundreds of times daily:

HotkeyAction Description
C-dDelete character at point
M-<backspace>Delete word backward
M-dDelete word forward
C-kKill (cut) from cursor to end of line
C-wKill (cut) selected region
M-wCopy selected region
C-yYank (paste) most recently killed text
M-yCycle through kill ring after yanking
C-/ or C-_Undo

A unique aspect of Emacs is its “kill ring” - a clipboard system that remembers multiple deleted items. After using C-y to paste the most recent item, you can press M-y repeatedly to cycle through previously killed text.

Region and Selection

Working with selections in Emacs involves understanding the concept of the “mark” and “point”:

HotkeyAction Description
C-spaceSet mark (start selection)
C-x C-xExchange point and mark (swap selection endpoints)
C-x hSelect entire buffer

The mark is where a selection begins, and the point is your cursor position. Together they define the “region” - Emacs’ term for a selection.

File Operations

These commands handle file management tasks:

HotkeyAction Description
C-x C-fFind (open) file
C-x C-sSave current buffer
C-x sSave all buffers
C-x C-cExit Emacs
C-x dOpen directory (dired)

The C-x C-f command is particularly powerful as it allows you to create new files by entering paths that don’t exist yet.

Buffer Management

In Emacs, a buffer is essentially an open file or space for editing:

HotkeyAction Description
C-x bSwitch buffer
C-x kKill (close) buffer

Efficient buffer navigation is crucial when working with multiple files.

Window Management

Emacs allows for sophisticated window layouts:

HotkeyAction Description
C-x 2Split window horizontally (one above the other)
C-x 3Split window vertically (side by side)
C-x oSwitch to other window
C-x 0Close current window
C-x 1Close all windows except current
C-x 5 2Create new frame (GUI window)

The ability to split the editor into multiple windows, each showing different buffers, is one of Emacs’ most powerful features.

Search and Replace

Finding and replacing text efficiently is essential for editing:

HotkeyAction Description
C-sIncremental search forward
C-rIncremental search backward
M-%Query replace

Emacs’ incremental search updates as you type, making it quick to locate specific text.

Help System

When you inevitably need guidance, Emacs has built-in help:

HotkeyAction Description
C-h fDescribe function
C-h kDescribe key
C-h tStart tutorial

The self-documenting nature of Emacs means help is always just a few keystrokes away.

Macros

Macros are powerful tools for automating repetitive tasks:

HotkeyAction Description
F3Start recording a keyboard macro
F4Stop recording or execute the most recent keyboard macro

To use macros: press F3, perform the sequence of actions you want to repeat, press F4 to finish recording, then press F4 again each time you want to replay those exact keystrokes. This is incredibly useful for mass operations on text.

Command Execution

Finally, the gateway to thousands of Emacs commands:

HotkeyAction Description
M-xExecute command by name

This shortcut unlocks Emacs’ full potential, giving you access to any command by name.

Building Your Muscle Memory

Learning these hotkeys will take time, but the productivity payoff is immense. Start by mastering the navigation and basic editing commands, then gradually incorporate the others. Consider printing this list and keeping it near your workspace until the keystrokes become automatic.

Remember that Emacs is highly customizable - once you’re comfortable with these basics, you can create your own keybindings for commands you use frequently.

Conclusion

The beauty of Emacs lies in how it becomes an extension of your thinking process once you’ve internalized these commands. Text manipulation becomes effortless, allowing you to focus on your actual work rather than the mechanics of editing.

emacs-mind

While this guide covers the essential hotkeys, it barely scratches the surface of what Emacs can do. As you grow more comfortable with these basics, explore specialized modes for your particular work, whether that’s programming in specific languages, writing prose, managing projects, or organizing your life.

What began as a seemingly steep learning curve will transform into a powerful skillset that follows you throughout your computing life. Happy editing!