Quick Reference Guide
Quick Guide to Emacs
A collection of commonly used keystrokes and configuration tips for GNU Emacs. Covers navigation, editing, buffers, search, and macros.
Note: This guide was originally published in 2006 and has been updated in May 2026 with corrected key notation, additional sections, and improved formatting, with assistance from Claude (Anthropic).
Key Notation
Emacs key bindings are written in a standard shorthand throughout this guide:
| Notation | Meaning | Example |
C-x | Hold Ctrl and press x | C-x C-s means hold Ctrl, press x, then press s |
M-x | Hold Meta (Alt/Esc) and press x | On most keyboards, Meta is the Alt key |
C-SPC | Hold Ctrl and press Spacebar | Sets the mark for region selection |
To run the built-in Emacs tutorial at any time: C-h t
Useful Settings for .emacs
Add these to ~/.emacs or ~/.emacs.d/init.el to configure Emacs on startup:
(line-number-mode 1) ; show line number in mode line
(column-number-mode 1) ; show column number in mode line
(display-time) ; show clock in mode line
(load-theme 'deeper-blue t); set colour theme
To reload your config without restarting: M-x load-file RET ~/.emacs RET
File Operations
| Action | Keystroke |
| Open / find file | C-x C-f |
| Save file | C-x C-s |
| Save as (write to new file) | C-x C-w |
| Quit Emacs | C-x C-c |
Navigation
| Action | Keystroke |
| Go to line number | M-g g |
| Go to beginning of buffer | M-< |
| Go to end of buffer | M-> |
| Move between windows | C-x o |
| Scroll down / up | C-v / M-v |
Editing
| Action | Keystroke |
| Set mark (start region selection) | C-SPC |
| Exchange mark and point | C-x C-x |
| Kill (cut) line | C-k |
| Yank (paste) | C-y |
| Undo | C-/ or C-_ |
| Kill (cut) rectangle region | C-x r k |
| Yank (paste) rectangle region | C-x r y |
| Toggle comment on region | M-; |
Buffers and Windows
| Action | Keystroke |
| List all open buffers | C-x C-b |
| Switch to buffer | C-x b |
| Kill (close) buffer | C-x k |
| Split window horizontally | C-x 2 |
| Split window vertically | C-x 3 |
| Close current window | C-x 0 |
| Close all other windows | C-x 1 |
Search and Replace
| Action | Keystroke |
| Incremental search forward | C-s |
| Incremental search backward | C-r |
| Query replace (interactive find and replace) | M-% |
| Replace all (no prompt) | M-x replace-string |
During incremental search, press C-s again to jump to the next match, or RET to exit search at the current position.
Keystroke Macros
Macros let you record a sequence of keystrokes and replay them. Useful for repetitive edits across many lines.
| Action | Keystroke |
| Start recording macro | C-x ( |
| Stop recording macro | C-x ) |
| Playback last macro | C-x e |
Useful Packages and Modes
Emacs can be extended with packages. These two are easy to install and immediately useful:
| Package | What it does |
| Flyspell | On-the-fly spell checking as you type, similar to spell check in word processors |
| X-Symbol | Renders superscript, subscript and Greek characters visually in LaTeX buffers |
Modern Emacs (26+) ships with a built-in package manager. To browse and install packages: M-x package-list-packages. For LaTeX grammar checking, convert your document to HTML first and use an online grammar checker, as LaTeX-native grammar tools are limited.
For the complete built-in reference, use C-h k (describe key) or C-h f (describe function) at any time within Emacs. The official manual is available at gnu.org/software/emacs/manual.
6 thoughts on “Quick Guide to Emacs”