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
UndoCtrl+/Ctrl+/
Undo (alternative)Ctrl+X UCtrl+X U
Universal argument (repeat/modify next command)Ctrl+UCtrl+U
Repeat last commandCtrl+X ZCtrl+X Z
Quit EmacsCtrl+X Ctrl+CCtrl+X Ctrl+C
Run shell commandAlt+!Alt+!

Files & Buffers

Open (find) fileCtrl+X Ctrl+FCtrl+X Ctrl+F
Save fileCtrl+X Ctrl+SCtrl+X Ctrl+S
Save as (write file)Ctrl+X Ctrl+WCtrl+X Ctrl+W
Save all modified buffersCtrl+X SCtrl+X S
Switch bufferCtrl+X BCtrl+X B
List all buffersCtrl+X Ctrl+BCtrl+X Ctrl+B
Kill (close) bufferCtrl+X KCtrl+X K
Open directory browser (Dired)Ctrl+X DCtrl+X D

Cursor Movement

Forward one characterCtrl+FCtrl+F
Backward one characterCtrl+BCtrl+B
Next lineCtrl+NCtrl+N
Previous lineCtrl+PCtrl+P
Forward one wordAlt+FAlt+F
Backward one wordAlt+BAlt+B
Beginning of lineCtrl+ACtrl+A
End of lineCtrl+ECtrl+E
Back to first non-whitespace characterAlt+MAlt+M
Beginning of sentenceAlt+AAlt+A
End of sentenceAlt+EAlt+E
Forward one paragraphAlt+}Alt+}
Backward one paragraphAlt+{Alt+{
Scroll down one screenCtrl+VCtrl+V
Scroll up one screenAlt+VAlt+V
Beginning of bufferAlt+<Alt+<
End of bufferAlt+>Alt+>
Go to line numberAlt+G GAlt+G G
Recenter screen on cursorCtrl+LCtrl+L

Editing, Kill & Yank

Delete character forwardCtrl+DCtrl+D
Kill (cut) to end of lineCtrl+KCtrl+K
Kill word forwardAlt+DAlt+D
Kill word backwardAlt+BackspaceAlt+Backspace
Kill (cut) regionCtrl+WCtrl+W
Copy region (kill-ring-save)Alt+WAlt+W
Yank (paste)Ctrl+YCtrl+Y
Cycle through earlier kills after yankAlt+YAlt+Y
Open new line below cursorCtrl+OCtrl+O
Transpose charactersCtrl+TCtrl+T
Transpose wordsAlt+TAlt+T
Transpose linesCtrl+X Ctrl+TCtrl+X Ctrl+T
Uppercase wordAlt+UAlt+U
Lowercase wordAlt+LAlt+L
Capitalize wordAlt+CAlt+C
Refill (rewrap) paragraphAlt+QAlt+Q
Comment or uncomment current lineCtrl+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 markCtrl+X Ctrl+XCtrl+X Ctrl+X
Select entire bufferCtrl+X HCtrl+X H

Search & Replace

Incremental search forwardCtrl+SCtrl+S
Incremental search backwardCtrl+RCtrl+R
Regexp incremental searchCtrl+Alt+SCtrl+Alt+S
Query replaceAlt+%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 windowsCtrl+X 1Ctrl+X 1
Close current windowCtrl+X 0Ctrl+X 0
Switch to other windowCtrl+X OCtrl+X O
Open new frame (OS window)Ctrl+X 5 2Ctrl+X 5 2
Close current frameCtrl+X 5 0Ctrl+X 5 0

Keyboard Macros

Start recording macroF3F3
Stop recording / play macroF4F4

Help

Describe what a key doesCtrl+H KCtrl+H K
Describe a functionCtrl+H FCtrl+H F
Describe a variableCtrl+H VCtrl+H V
List all key bindingsCtrl+H BCtrl+H B
Open the Emacs tutorialCtrl+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.

See the macropads

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.