GNU Emacs keyboard shortcuts
GNU Emacs is the legendary, endlessly extensible text editor whose default keybindings have been stable for decades and are identical on Windows and Mac. Emacs documentation writes shortcuts as C-x (Ctrl+X) and M-x (Meta+X, which is Alt on Windows and Option or Esc on Mac); this sheet converts that notation to Ctrl and Alt style, with multi-key sequences shown as consecutive chords like Ctrl+X Ctrl+F. This cheat sheet covers 75 default shortcuts for Windows and Mac.
Basics & Commands
| Execute command by name (M-x) | Alt+XAlt+X |
| Cancel current command (keyboard-quit) | Ctrl+GCtrl+G |
| Undo | Ctrl+/Ctrl+/ |
| Undo (alternative) | Ctrl+X UCtrl+X U |
| Universal argument (repeat/modify next command) | Ctrl+UCtrl+U |
| Repeat last command | Ctrl+X ZCtrl+X Z |
| Quit Emacs | Ctrl+X Ctrl+CCtrl+X Ctrl+C |
| Run shell command | Alt+!Alt+! |
Files & Buffers
| Open (find) file | Ctrl+X Ctrl+FCtrl+X Ctrl+F |
| Save file | Ctrl+X Ctrl+SCtrl+X Ctrl+S |
| Save as (write file) | Ctrl+X Ctrl+WCtrl+X Ctrl+W |
| Save all modified buffers | Ctrl+X SCtrl+X S |
| Switch buffer | Ctrl+X BCtrl+X B |
| List all buffers | Ctrl+X Ctrl+BCtrl+X Ctrl+B |
| Kill (close) buffer | Ctrl+X KCtrl+X K |
| Open directory browser (Dired) | Ctrl+X DCtrl+X D |
Cursor Movement
| Forward one character | Ctrl+FCtrl+F |
| Backward one character | Ctrl+BCtrl+B |
| Next line | Ctrl+NCtrl+N |
| Previous line | Ctrl+PCtrl+P |
| Forward one word | Alt+FAlt+F |
| Backward one word | Alt+BAlt+B |
| Beginning of line | Ctrl+ACtrl+A |
| End of line | Ctrl+ECtrl+E |
| Back to first non-whitespace character | Alt+MAlt+M |
| Beginning of sentence | Alt+AAlt+A |
| End of sentence | Alt+EAlt+E |
| Forward one paragraph | Alt+}Alt+} |
| Backward one paragraph | Alt+{Alt+{ |
| Scroll down one screen | Ctrl+VCtrl+V |
| Scroll up one screen | Alt+VAlt+V |
| Beginning of buffer | Alt+<Alt+< |
| End of buffer | Alt+>Alt+> |
| Go to line number | Alt+G GAlt+G G |
| Recenter screen on cursor | Ctrl+LCtrl+L |
Editing, Kill & Yank
| Delete character forward | Ctrl+DCtrl+D |
| Kill (cut) to end of line | Ctrl+KCtrl+K |
| Kill word forward | Alt+DAlt+D |
| Kill word backward | Alt+BackspaceAlt+Backspace |
| Kill (cut) region | Ctrl+WCtrl+W |
| Copy region (kill-ring-save) | Alt+WAlt+W |
| Yank (paste) | Ctrl+YCtrl+Y |
| Cycle through earlier kills after yank | Alt+YAlt+Y |
| Open new line below cursor | Ctrl+OCtrl+O |
| Transpose characters | Ctrl+TCtrl+T |
| Transpose words | Alt+TAlt+T |
| Transpose lines | Ctrl+X Ctrl+TCtrl+X Ctrl+T |
| Uppercase word | Alt+UAlt+U |
| Lowercase word | Alt+LAlt+L |
| Capitalize word | Alt+CAlt+C |
| Refill (rewrap) paragraph | Alt+QAlt+Q |
| Comment or uncomment current line | Ctrl+X Ctrl+;Ctrl+X Ctrl+; |
| Comment/uncomment region (comment-dwim) | Alt+;Alt+; |
| Dynamic word completion (dabbrev) | Alt+/Alt+/ |
Selection & Marks
| Set mark (start selection) | Ctrl+SpaceCtrl+Space |
| Swap point and mark | Ctrl+X Ctrl+XCtrl+X Ctrl+X |
| Select entire buffer | Ctrl+X HCtrl+X H |
Search & Replace
| Incremental search forward | Ctrl+SCtrl+S |
| Incremental search backward | Ctrl+RCtrl+R |
| Regexp incremental search | Ctrl+Alt+SCtrl+Alt+S |
| Query replace | Alt+%Alt+% |
Windows & Frames
| Split window horizontally (one above the other) | Ctrl+X 2Ctrl+X 2 |
| Split window vertically (side by side) | Ctrl+X 3Ctrl+X 3 |
| Close all other windows | Ctrl+X 1Ctrl+X 1 |
| Close current window | Ctrl+X 0Ctrl+X 0 |
| Switch to other window | Ctrl+X OCtrl+X O |
| Open new frame (OS window) | Ctrl+X 5 2Ctrl+X 5 2 |
| Close current frame | Ctrl+X 5 0Ctrl+X 5 0 |
Keyboard Macros
| Start recording macro | F3F3 |
| Stop recording / play macro | F4F4 |
Help
| Describe what a key does | Ctrl+H KCtrl+H K |
| Describe a function | Ctrl+H FCtrl+H F |
| Describe a variable | Ctrl+H VCtrl+H V |
| List all key bindings | Ctrl+H BCtrl+H B |
| Open the Emacs tutorial | Ctrl+H TCtrl+H T |
Put your top GNU Emacs shortcuts on real keys
The five GNU Emacs actions most worth binding to a physical macropad key:
Alt+XAlt+X Execute command (M-x) The gateway to every Emacs command by name; used constantly all day.
Ctrl+X Ctrl+SCtrl+X Ctrl+S Save file The single most repeated two-chord sequence in Emacs, collapsed to one key.
Ctrl+X Ctrl+FCtrl+X Ctrl+F Open file Turns the classic find-file chord dance into a single press.
Ctrl+X BCtrl+X B Switch buffer Buffer hopping is the core Emacs workflow; a hardware key makes it instant.
F4F4 Play keyboard macro Hammering a recorded macro across hundreds of lines begs for a dedicated physical key.
I hand-build small-batch programmable macropads (QMK/VIA) in Barcelona. One press, any shortcut, any app.
GNU Emacs shortcut FAQs
What do C-x and M-x mean in Emacs shortcuts?
C- means hold Ctrl and M- means hold Meta, so C-x is Ctrl+X and M-x is Alt+X. On Windows and Linux, Meta is the Alt key; on Mac it is usually Option (or press Esc first). Sequences like C-x C-f mean press Ctrl+X, then Ctrl+F.
How do I exit Emacs?
Press Ctrl+X then Ctrl+C (C-x C-c). Emacs will prompt you to save any modified buffers before it quits.
How do I cancel a command I started in Emacs?
Press Ctrl+G (keyboard-quit). It aborts the current command, minibuffer prompt or partially typed key sequence. Press it whenever Emacs seems stuck.
Are Emacs shortcuts the same on Windows and Mac?
Yes, the default bindings are identical. The only difference is which physical key acts as Meta: Alt on Windows and Linux, Option (or Esc as a prefix) on Mac.
How do I copy and paste in Emacs?
Set the mark with Ctrl+Space, move to select, then Alt+W copies and Ctrl+W cuts (kills). Ctrl+Y yanks (pastes), and Alt+Y right after cycles through older clipboard entries in the kill ring.