Emacs Cheat Sheet
A searchable reference of common GNU Emacs keyboard shortcuts and what each one does.
| Keys | What it does |
|---|---|
C-x C-f | Open a file by name, creating it if it does not exist yet (find-file). |
C-x C-s | Save the current buffer back to its file. |
C-x C-w | Write the current buffer to a new file name (save as). |
C-x C-c | Exit Emacs, offering to save any buffers with unsaved changes. |
C-x b | Switch to another buffer by name. |
C-x C-b | List all open buffers in a window. |
C-x k | Kill a buffer, removing it from the list of open buffers. |
C-x s | Save some or all buffers that have unsaved changes. |
C-f | Move the cursor forward one character. |
C-b | Move the cursor backward one character. |
C-n | Move to the next line. |
C-p | Move to the previous line. |
C-a | Move to the beginning of the current line. |
C-e | Move to the end of the current line. |
M-f | Move forward one word. |
M-b | Move backward one word. |
M-< | Jump to the beginning of the buffer. |
M-> | Jump to the end of the buffer. |
C-v | Scroll forward one screen (page down). |
M-v | Scroll backward one screen (page up). |
M-g g | Go to a line by its number (goto-line). |
C-d | Delete the character after the cursor. |
M-d | Kill (cut) forward to the end of the next word. |
C-k | Kill (cut) from the cursor to the end of the line. |
C-w | Kill (cut) the region between the mark and the cursor. |
M-w | Copy the region between the mark and the cursor to the kill ring. |
C-y | Yank (paste) the most recently killed or copied text. |
M-y | After a yank, cycle back through earlier kill-ring entries. |
C-/ | Undo the last change (repeat to undo more). |
C-x u | Undo the last change (same as C-/). |
C-x h | Select the whole buffer (mark-whole-buffer). |
C-o | Open a blank line after the cursor, leaving the cursor in place. |
C-s | Search incrementally forward as you type (isearch). |
C-r | Search incrementally backward as you type. |
M-% | Find and replace with confirmation for each match (query-replace). |
C-M-s | Search incrementally forward using a regular expression. |
M-x occur | List every line in the buffer that matches a regexp in a separate window. |
C-x 2 | Split the current window into two stacked windows, one above the other. |
C-x 3 | Split the current window into two side-by-side windows. |
C-x o | Move the cursor to the other window. |
C-x 1 | Close every window except the current one. |
C-x 0 | Close the current window. |
C-x 5 2 | Open a new frame (a separate operating-system window). |
C-g | Cancel the command in progress and return to a clean state. |
M-x | Run any command by typing its full name (execute-extended-command). |
C-h k | Describe what a key sequence does (describe-key). |
C-h f | Describe a function by name (describe-function). |
C-SPC | Set the mark at the cursor to begin selecting a region. |
C-x C-x | Exchange the cursor and the mark, jumping to the other end of the region. |
M-x package-install | Download and install a package from a configured archive. |
No shortcuts match your search.
Runs entirely in your browser. Nothing you type is sent anywhere; open DevTools and watch the Network tab to verify zero requests.
What this tool does
This is a searchable quick reference for the GNU Emacs keyboard shortcuts you reach
for every day, from opening and saving files to moving around, editing text, searching,
and managing windows. Each row pairs the exact key sequence with a plain-English note on
what it does. In Emacs notation, C- means hold the Control key while you press
the next key and M- means hold the Meta key, which is Alt on most keyboards.
A shortcut like C-x C-s therefore means hold Control and press x, then hold
Control and press s. The whole list is built into the page, so it works offline and sends
nothing anywhere.
How to use it
Start typing in the Filter box. Entering save jumps to the
file commands; entering kill surfaces the ways to cut and delete text;
entering split shows the window commands. The category buttons
(Files and buffers, Movement, Editing, Search, Windows, Misc) narrow the table to one group
and combine with the text filter, so you can pick Editing and type word to zero
in on the word-level commands. Clear the box to see the full sheet again.
Common use cases
- Recalling a shortcut you use rarely, like
C-x 5 2to open a new frame orM-%to run query replace. - Copying the exact key sequence into your notes instead of guessing.
- Teaching a newcomer the core movement and editing keys.
- Looking up how to save, quit, or cancel when a session gets stuck.
- Reviewing the essential Emacs bindings before a workshop or a new job.
Common pitfalls
- Confusing C- and M-.
C-is the Control key andM-is Meta, which is Alt on most keyboards. If a Meta shortcut does nothing, press and release Escape first and then the key, which Emacs treats the same as holding Meta. - Getting stuck mid-command. A half-typed key sequence can leave Emacs
waiting for more input. Press
C-gto cancel and return to a clean state, then try again. - Losing text after a yank.
M-yonly works right afterC-y; it cycles through the kill ring rather than pasting fresh text. Yank first withC-y, then pressM-yto reach earlier entries. - Killing the wrong buffer or window.
C-x kkills a buffer,C-x 0closes the current window, andC-x 1closes every other window. They sound similar but do different things, so read the key before you press it, and note that killing a buffer with unsaved changes will prompt you to save first.
Frequently asked questions
- What do C- and M- mean in Emacs key bindings?
- C- means hold the Control key while you press the following key, and M- means hold the Meta key, which is Alt on most keyboards, or you can press and release Escape first and then the key. So C-x C-s reads as hold Control and press x, then hold Control and press s. A space between groups means release and start the next chord, so M-g g means press M-g and then tap g on its own.
- How do I save a file and quit Emacs?
- Save the current file with C-x C-s. To save it under a new name, use C-x C-w. When you are ready to leave, C-x C-c exits Emacs and offers to save any buffers that still have unsaved changes. If you only want to save every open buffer without quitting, use C-x s.
- How do I copy and paste in Emacs?
- Set the mark at one end of the text with C-SPC, move the cursor to the other end, then press M-w to copy or C-w to cut. Paste the copied or cut text at the cursor with C-y, which Emacs calls yank. Right after a yank you can press M-y to cycle back through earlier items in the kill ring.
- How do I cancel a command in Emacs?
- Press C-g to quit the command in progress and return to a clean state. It cancels a partially typed key sequence, stops an incremental search, and dismisses a minibuffer prompt. If a command left you somewhere unexpected, C-g followed by C-/ to undo will usually get you back.
- How do I run an Emacs command by its name?
- Press M-x, type the command name at the prompt, and press Enter. This runs any command even when it has no key binding, for example M-x occur or M-x package-install. Tab completion helps you find the exact name, so you can type part of it and let Emacs fill in the rest.
- Does this cheat sheet send my searches anywhere?
- No. The whole shortcut list is baked into the page and every filter runs in your browser with JavaScript, so nothing you type leaves your device. Open your browser DevTools and watch the Network tab while you search to confirm there are zero requests.
Cite this tool
For academic, journalistic, or technical references. Pick a format:
Citations use 2026 as the publication year. Access date is left as a fillable placeholder where the citation style expects one.