Complete Emacs Keyboard Shortcuts Cheat Sheet (150+ Key Bindings)
Emacs keyboard shortcuts use two modifier keys: C- (hold Control) and M- (hold Alt, or press then release Escape). The most essential shortcuts are C-x C-f to open a file, C-x C-s to save, C-g to cancel any command, and M-x to run any Emacs command by name.
GNU Emacs is one of the oldest and most powerful text editors in existence first released in 1976 by Richard Stallman as part of the GNU Project, it has over 3,000 built-in commands accessible entirely from the keyboard. Unlike most modern editors, Emacs is designed to be operated without ever touching the mouse, which is why mastering its shortcuts is the single biggest productivity unlock for developers, writers, and system administrators who use it daily.
This cheat sheet covers 150+ Emacs keyboard shortcuts organized into 12 categories from basic file operations and navigation to buffer management, macros, and the help system. Whether you are a complete beginner who just installed Emacs for the first time, or an experienced user who wants a reliable reference to bookmark, this page has everything you need.
Before you start: Here is how to read Emacs shortcut notation:
| Notation | Meaning | Example |
|---|---|---|
| C-x | Hold Ctrl, press x | C-x C-s = save file |
| M-x | Hold Alt, press x (or press Esc, release, then press x) | M-x = run command by name |
| C-x C-f | Hold Ctrl, press x, then still holding Ctrl, press f | Opens a file |
| SPC | Spacebar | Used in Spacemacs / Doom Emacs |
| RET | Enter / Return key | Confirms a command |
| DEL | Backspace key |
Quick tip: If you ever get stuck or accidentally trigger a command you don’t recognize, press C-g this is the universal cancel key in Emacs and will safely abort whatever is running.
Most Used Emacs Shortcuts (Essential Commands)
These are the shortcuts every Emacs user must know on day one. Learn these first before anything else.
| Action | Shortcut | Notes |
|---|---|---|
| Open a file | C-x C-f | “Find file” creates new file if it doesn’t exist |
| Save current buffer | C-x C-s | Saves in place |
| Save as (write to new file) | C-x C-w | Prompts for new filename |
| Save all open buffers | C-x s | Prompts for each unsaved buffer |
| Revert buffer to saved file | M-x revert-buffer | Discards unsaved changes |
| Quit Emacs | C-x C-c | Prompts to save unsaved buffers |
| Suspend Emacs (terminal) | C-z | Sends to background; resume with fg |
| Cancel current command | C-g | Universal abort use this when stuck |
| Undo | C-x u or C-/ | Emacs has unlimited undo |
| Redo (undo the undo) | C-g then C-/ | Press C-g first to break the undo chain |
| Run command by name | M-x | Most powerful shortcut in Emacs |
| Repeat last command | C-x z | Press z again to keep repeating |
| Execute keyboard macro | C-x e | Runs the last recorded macro |
Navigation Shortcuts
Navigation is the most-used category of shortcuts in daily Emacs use.
| Action | Shortcut | Notes |
|---|---|---|
| Move forward one character | C-f | |
| Move backward one character | C-b | |
| Move forward one word | M-f | |
| Move backward one word | M-b | |
| Move to next line | C-n | |
| Move to previous line | C-p | |
| Move to beginning of line | C-a | |
| Move to end of line | C-e | |
| Move to beginning of sentence | M-a | |
| Move to end of sentence | M-e | |
| Move to beginning of paragraph | M-{ | |
| Move to end of paragraph | M-} | |
| Move to beginning of buffer | M-< | |
| Move to end of buffer | M-> | |
| Scroll down one screen | C-v | |
| Scroll up one screen | M-v | |
| Center screen on cursor | C-l | Press again to cycle top/bottom/center |
| Go to line number | M-g M-g | Prompts for line number |
| Go to character position | M-g c | |
| Jump to matching bracket | C-M-f / C-M-b | Forward / backward |
File Handling Shortcuts
| Action | Shortcut | Notes |
|---|---|---|
| Open / find a file | C-x C-f | |
| Save file | C-x C-s | |
| Save file as | C-x C-w | |
| Insert file into buffer | C-x i | Inserts at cursor position |
| Open file in read-only mode | C-x C-r | |
| Toggle read-only mode | C-x C-q | |
| Open recent files | M-x recentf-open-files | Enable recentf-mode first |
| Open file manager (Dired) | C-x d | Built-in directory editor |
| Open file in other window | C-x 4 C-f | Splits screen and opens there |
| Open file in new frame | C-x 5 C-f | New OS window |
Killing (Cutting) and Yanking (Pasting)
Emacs uses its own terminology: kill = cut, yank = paste, kill ring = clipboard history.
| Action | Shortcut | Notes |
|---|---|---|
| Cut (kill) selected region | C-w | |
| Copy selected region | M-w | Saves to kill ring without deleting |
| Paste (yank) | C-y | Pastes most recent kill |
| Cycle through clipboard history | M-y | Press after C-y to cycle older kills |
| Kill (cut) to end of line | C-k | Press twice to kill the newline too |
| Kill entire line | C-S-backspace | |
| Kill word forward | M-d | |
| Kill word backward | M-DEL | |
| Delete character forward | C-d | Does not go to kill ring |
| Delete character backward | DEL | Backspace |
| Kill to end of sentence | M-k | |
| Kill region between cursor and mark | C-w | Set mark first with C-SPC |
Search and Replace Shortcuts
| Action | Shortcut | Notes |
|---|---|---|
| Incremental search forward | C-s | Type to search as you go; C-s again = next match |
| Incremental search backward | C-r | |
| Search forward with regex | C-M-s | Regular expression search |
| Search backward with regex | C-M-r | |
| Exit search at current position | RET | |
| Cancel search, return to start | C-g | |
| Query replace | M-% | Prompts y/n for each match |
| Query replace with regex | C-M-% | |
| Replace all without prompting | M-x replace-string | |
| Find next occurrence | C-s | While already in search mode |
| Occur (list all matches) | M-x occur | Shows all matches in a new buffer |
Marking and Selecting (Region)
| Action | Shortcut | Notes |
|---|---|---|
| Set mark (start selection) | C-SPC | Sets the mark at cursor position |
| Select all (mark whole buffer) | C-x h | |
| Mark current word | M-@ | |
| Mark current paragraph | M-h | |
| Mark current function / defun | C-M-h | |
| Exchange cursor and mark | C-x C-x | Jumps to where selection started |
| Activate / show mark | C-SPC C-SPC | |
| Select rectangle region | C-x SPC | For rectangle operations |
Buffer Management Shortcuts
| Action | Shortcut | Notes |
|---|---|---|
| Switch to another buffer | C-x b | Type buffer name; Tab to autocomplete |
| List all open buffers | C-x C-b | Opens buffer list in a window |
| Kill (close) current buffer | C-x k | Prompts for confirmation if unsaved |
| Kill buffer without prompt | M-x kill-this-buffer | |
| Switch to previous buffer | C-x LEFT | Cycles backward |
| Switch to next buffer | C-x RIGHT | Cycles forward |
| Rename current buffer | M-x rename-buffer | |
| Open buffer in other window | C-x 4 b | |
| Save all unsaved buffers | C-x s | |
| Revert buffer from disk | M-x revert-buffer | Reloads file from disk |
Window and Frame Shortcuts
| Action | Shortcut | Notes |
|---|---|---|
| Split window horizontally (top/bottom) | C-x 2 | |
| Split window vertically (left/right) | C-x 3 | |
| Close current window | C-x 0 | Buffer stays open |
| Close all other windows | C-x 1 | Maximizes current window |
| Switch to other window | C-x o | Cycles through open windows |
| Scroll other window down | C-M-v | |
| Grow window taller | C-x ^ | |
| Shrink window narrower | C-x { | |
| Grow window wider | C-x } | |
| Open new OS frame (window) | C-x 5 2 | |
| Close current frame | C-x 5 0 | |
| Switch to other frame | C-x 5 o |
Formatting and Indentation Shortcuts
| Action | Shortcut | Notes |
|---|---|---|
| Indent current line | TAB | Context-aware in most modes |
| Indent region | C-M-\ | |
| Fill / re-wrap paragraph | M-q | Wraps to fill-column width |
| Set fill column width | C-x f | Default is 70 characters |
| Join line with previous line | M-^ | Removes leading whitespace |
| Delete all whitespace at point | M-\ | |
| Insert one space at point | M-SPC | |
| Uppercase word | M-u | |
| Lowercase word | M-l | |
| Capitalize word | M-c | |
| Uppercase region | C-x C-u | |
| Lowercase region | C-x C-l | |
| Comment / uncomment region | M-; | |
| Insert newline and indent | C-j | |
| Transpose two characters | C-t | Swaps character before and after cursor |
| Transpose two words | M-t | |
| Transpose two lines | C-x C-t |
Macro Shortcuts
| Action | Shortcut | Notes |
|---|---|---|
| Start recording macro | C-x ( | Everything you type is recorded |
| Stop recording macro | C-x ) | |
| Run last macro | C-x e | Press e again to repeat |
| Run macro N times | C-u N C-x e | e.g. C-u 10 C-x e runs 10 times |
| Name last macro | M-x name-last-kbd-macro | Lets you call it by name with M-x |
| Save macro to init file | M-x insert-kbd-macro | Inserts macro definition as Lisp |
Help System Shortcuts
| Action | Shortcut | Notes |
|---|---|---|
| Open Emacs tutorial | C-h t | Best starting point for beginners |
| Describe a key binding | C-h k | Then press any key to see what it does |
| Describe a function | C-h f | Type function name to see its docs |
| Describe a variable | C-h v | |
| Show all key bindings | C-h b | Full list of active bindings |
| Find commands matching string | C-h a | Apropos search |
| Show key binding for command | C-h w | Reverse lookup |
| Open Emacs manual | C-h i | Full Info documentation browser |
| Show mode-specific help | C-h m | Shows current major and minor modes |
| Toggle quick-help cheat sheet | C-h C-q | Built-in cheat sheet in Emacs 29+ |
| Describe current mode | C-h m | |
| Show recent messages | C-h e | View the * Messages * buffer |
Dired (Built-in File Manager) Shortcuts
| Action | Shortcut | Notes |
|---|---|---|
| Open Dired | C-x d | Prompts for directory |
| Open file at cursor | RET | |
| Open file in other window | o | |
| Go up to parent directory | ^ | |
| Mark file for operation | m | |
| Unmark file | u | |
| Unmark all | U | |
| Delete marked files | D | |
| Copy marked files | C | Prompts for destination |
| Rename / move file | R | |
| Create new directory | + | |
| Compress / uncompress file | Z | |
| Run shell command on file | ! | |
| Refresh directory listing | g | |
| Toggle hidden files | C-x M-o |
Related: Best GNU Emacs Alternatives & Competitors
Emacs Shortcuts vs Vim Shortcuts: Side-by-Side Comparison
Emacs and Vim are the two most popular keyboard-driven text editors among developers and system administrators. Both are highly efficient once mastered, but they use fundamentally different philosophies for keyboard shortcuts. Here is how their key bindings compare for the most common editing tasks.
| Task | Emacs Shortcut | Vim Shortcut | Key Difference |
|---|---|---|---|
| Open a file | C-x C-f | :e filename | Emacs uses chord keys; Vim uses command-line mode |
| Save a file | C-x C-s | :w | Vim requires entering command mode first |
| Save and quit | C-x C-c (then confirm) | :wq or ZZ | Vim combines both in one command |
| Quit without saving | C-x C-c then n | :q! | |
| Undo | C-/ or C-x u | u | Vim’s undo is simpler; Emacs has unlimited linear undo |
| Redo | C-g then C-/ | C-r | Vim has a dedicated redo key |
| Cut line | C-k | dd | Emacs cuts to end of line; Vim cuts whole line |
| Copy line | M-w (after selecting) | yy | Vim’s yy yanks whole line without selecting |
| Paste | C-y | p | Both editors call this “yank” internally |
| Search forward | C-s | / | Emacs searches incrementally as you type |
| Search backward | C-r | ? | |
| Find and replace | M-% | :%s/old/new/g | Vim’s regex replace is more concise |
| Move to line start | C-a | 0 or ^ | |
| Move to line end | C-e | $ | |
| Move to file start | M-< | gg | Vim’s navigation is shorter |
| Move to file end | M-> | G | |
| Move forward one word | M-f | w | |
| Move backward one word | M-b | b | |
| Delete character | C-d | x | |
| Select a region | C-SPC then move cursor | v then move cursor | Both use visual/mark mode concept |
| Run a command | M-x command-name | :command-name | |
| Split window horizontally | C-x 2 | :split | |
| Split window vertically | C-x 3 | :vsplit | |
| Switch window | C-x o | C-w C-w | |
| Comment line | M-; | gc (with plugin) | Vim needs a plugin; Emacs has it built in |
| Open file manager | C-x d (Dired) | :Ex (netrw) | Both have built-in file managers |
| Access help | C-h k | :help | Emacs help is more interactive |
| Macro record start | C-x ( | ||
| Macro record stop | C-x ) | q | |
| Run macro | C-x e | @q |
Which Is Harder to Learn – Emacs or Vim?
Both editors have steep learning curves, but in different ways.
Vim has a steeper initial learning curve because it uses modal editing you are always in one of several modes (Normal, Insert, Visual, Command), and the same key does different things depending on which mode you are in. New users frequently get stuck because pressing keys in Normal mode triggers commands rather than typing text. However, once the modal concept clicks, Vim’s shortcuts tend to be shorter and faster to type single keys like dd, yy, and gg replace Emacs chord sequences.
Emacs has a gentler initial curve because it always behaves like a conventional editor you can type text immediately without switching modes. However, its shortcuts are chord-heavy, requiring you to hold Control or Alt for almost every command. Long-term Emacs use is associated with a condition known as “Emacs pinky” repetitive strain from constantly reaching for the Ctrl key which many users address by remapping Caps Lock to Control.
| Factor | Emacs | Vim |
|---|---|---|
| Initial learning curve | Moderate | Steep |
| Long-term mastery curve | Steep | Moderate |
| Shortcut style | Chord-based (C-x C-f) | Modal + single keys (dd, yy) |
| Typing without learning shortcuts | Yes, works immediately | No, must learn modes first |
| Extensibility | Emacs Lisp virtually unlimited | Vimscript / Lua (Neovim) |
| Startup time | Slower | Faster |
| Built-in features | Extremely rich (email, calendar, git) | Focused on text editing |
| Best for | Developers who want an OS-in-an-editor | Developers who want fast, focused editing |
| Popular distributions | Spacemacs, Doom Emacs | Neovim, LunarVim |
If you primarily want a fast, modal text editor, Vim or Neovim is the better starting point. If you want a deeply extensible environment where you can manage files, run Git, write org documents, and edit code all in one place, Emacs is worth the investment. Many experienced developers learn both.
Frequently Asked Questions About Emacs Shortcuts
How do I exit Emacs?
Press C-x C-c to quit Emacs. If you have unsaved buffers, Emacs will prompt you to save each one before closing. If you want to quit immediately without saving anything, type C-x C-c then answer no to each prompt. This is one of the most searched Emacs questions because new users often get trapped inside the editor C-x C-c is always the way out.
What does C- mean in Emacs shortcuts?
C- means hold the Control (Ctrl) key while pressing the next key. For example, C-s means hold Ctrl and press S. C-x C-f means hold Ctrl, press X, then still holding Ctrl, press F. The C- prefix is used for the most common, frequently-used commands in Emacs.
What does M- mean in Emacs shortcuts?
M- stands for Meta key, which on modern keyboards is the Alt key. For example, M-x means hold Alt and press X. If your Alt key does not work (common on macOS), you can also press and release the Escape key first, then press the next key so M-x becomes Esc then X. Both methods produce the same result.
How do I undo in Emacs?
Press C-/ or C-x u to undo in Emacs. Unlike most editors, Emacs has a linear unlimited undo history every change is recorded and can be undone. To redo (undo the undo), press C-g to break the undo chain, then press C-/ again. Emacs does not have a separate redo command; instead, undos become part of the history that can themselves be undone.
How do I save a file in Emacs?
Press C-x C-s to save the current file (buffer) in Emacs. To save a file under a different name, use C-x C-w (Save As). To save all open unsaved buffers at once, use C-x s Emacs will prompt you for each unsaved buffer individually.
How do I open a file in Emacs?
Press C-x C-f to open a file in Emacs. This command is called “find-file” and works for both existing files and creating new ones if the file does not exist, Emacs will create it when you save. You can also open a file in a second window alongside your current file using C-x 4 C-f.
How do I search for text in Emacs?
Press C-s to start an incremental search forward in Emacs. As you type your search term, Emacs jumps to the first match in real time. Press C-s again to jump to the next match. Press C-r to search backward. Press RET to stay at the current match, or C-g to cancel and return to where you started. For regular expression search, use C-M-s.
What is M-x in Emacs?
M-x is the command executor in Emacs pressing it opens a prompt where you can type the name of any Emacs command and run it. It is the most powerful shortcut in Emacs because it gives you access to all 3,000+ built-in commands, not just the ones with key bindings. For example, M-x replace-string runs a find-and-replace, and M-x org-mode switches the current buffer to Org mode.
How do I copy and paste in Emacs?
Emacs uses its own terminology for copy and paste. To copy text, first select it by setting a mark with C-SPC and moving the cursor, then press M-w to copy (called “kill-ring-save”). To paste, press C-y (called “yank”). To cut instead of copy, use C-w after selecting. Emacs maintains a clipboard history called the kill ring press M-y after yanking to cycle through previously copied items.
How do I switch between open files in Emacs?
Press C-x b to switch buffers in Emacs. Type the name of the buffer (file) you want to switch to press Tab to autocomplete. To see a list of all open buffers, press C-x C-b. Use C-x LEFT and C-x RIGHT to cycle backward and forward through buffers without typing a name.
What is the difference between Emacs shortcuts on Linux, macOS, and Windows?
Most GNU Emacs shortcuts work identically on Linux, macOS, and Windows. The main difference is the Meta key: on Linux and Windows, M- maps to the Alt key. On macOS, Alt/Option may not work by default you may need to either use the Escape key as Meta, or configure your terminal emulator to send Alt as Meta. On Windows, some C- shortcuts (like C-z, C-c, C-x) conflict with standard Windows shortcuts, which can be resolved by enabling CUA Mode in Emacs.
Conclusion
GNU Emacs has been the editor of choice for developers, researchers, and system administrators for nearly five decades and the reason is simple: once you internalize its keyboard shortcuts, you can edit text, manage files, run code, track tasks, and navigate your entire workflow without ever leaving the keyboard.
The shortcuts in this guide cover everything you need to go from complete beginner to confident daily Emacs user. Start with the essentials C-x C-f to open, C-x C-s to save, C-g to cancel, and M-x to run any command and build from there. Most experienced Emacs users will tell you the same thing: learn ten shortcuts deeply rather than fifty shortcuts shallowly. Muscle memory matters more than memorization.
If you ever get stuck, remember that C-h is your best friend C-h k describes any key you press, C-h f explains any function by name, and C-h t opens the built-in Emacs tutorial that ships with every installation.
If you are evaluating Emacs alongside other editors, our Vim shortcuts cheat sheet covers the full Vim key binding reference with the same level of detail as this guide. For terminal productivity beyond your editor, our Linux Mint keyboard shortcuts guide covers system-level shortcuts that pair well with Emacs on any Linux setup.
READ NEXT:





