Emacs Cheat Sheet

Go · Eglot · Vertico / Consult / Corfu / Embark · Magit · Treemacs · Org

Essentials & Help

C-gCancel / dismiss popup
C-x C-cQuit Emacs
C-x C-fFind (open) file
C-x C-sSave buffer
C-x sSave all buffers
M-xRun command by name
C-h kDescribe key
C-h f / C-h vDescribe function / variable
C-h mDescribe current modes
which-keyWaits 0.5s, then shows next keys
F1Open shell
F12todo-show

Movement

C-f / C-bChar forward / back
M-f / M-bWord forward / back
C-n / C-pNext / previous line
C-a / C-eStart / end of line
M-mBack to first non-blank char
M-a / M-eStart / end of sentence
M-< / M->Start / end of buffer
C-v / M-vPage down / up
PgDn / PgUpScroll half page (custom)
M-g gGo to line (consult)
C-u C-SPCJump back through marks
M-g mJump to mark (consult)

Avy — Fast Jump

M-jJump to char in current line
M-JJump by timed char sequence
M-g lJump to line
M-g wJump to word
M-g cJump to char

Select, Kill & Yank

C-SPCSet mark / start selection
C-x hSelect whole buffer
C-w / M-wCut / copy region
C-yYank (paste)
M-yYank history (consult-yank-pop)
C-kKill whole line (configured)
M-d / M-DELKill word forward / back
C-=Expand region outward
M-;Comment / uncomment
M-/Dabbrev expand word
M-qRe-fill paragraph

Undo & Multiple Cursors

C-/Undo
C-?Redo (undo-tree)
C-x uVisualize undo tree
C->Mark next like this
C-<Mark previous like this
C-c C-<Mark all like this
C-S-c C-S-cCursor on each selected line
C-S-mouse-1Add cursor at click
C-c ;iedit — rename all occurrences

Minibuffer & History

M-p / M-nPrevious / next history entry
M-n (empty prompt)Insert symbol at point ("future history")
C-r (in minibuffer)consult-history — searchable history list
C-x M-:Re-run a previous complex command
C-c C-eEmbark export results to a buffer
C-.Embark act on current candidate
wgrepEdit grep buffer, C-c C-c to apply
savehistHistory persists across restarts

Windows & Buffers

C-x 2 / C-x 3Split below / right
C-x 1Only this window
C-x 0Delete this window
M-oOther window
M-0Delete window, or kill buffer if last
C-c ← / C-c →Winner undo / redo layout
C-x bSwitch buffer (consult)
C-RETSwitch buffer (consult)
C-x 4 bBuffer in other window
C-TABToggle last buffer
C-S-TABPrevious buffer
C-x kKill buffer
C-x C-bIbuffer (grouped)

Search & Consult

C-s / C-rIsearch forward / backward
C-s C-sRepeat last search string
C-s at "Failing"Wrap around to top of buffer
In isearch: C-wGrow search by word at point
In isearch: M-s wToggle word-boundary search
In isearch: M-s cToggle case sensitivity
In isearch: M-s lHand off to consult-line
In isearch: M-eEdit the search string
M-% / C-M-%Query replace / regexp
M-s lconsult-line — whole buffer, any direction
M-s Lconsult-line-multi (all buffers)
M-s pconsult-fd — find file by name
M-s gconsult-grep
M-s rconsult-ripgrep (fast)
M-g iconsult-imenu — jump to symbol
<Narrow key inside consult

Completion — Corfu & Vertico

TABAccept completion (Corfu)
RETNewline — never completes (fixed)
C-n / C-pNext / previous candidate
C-gDismiss popup
C-M-iTrigger completion manually
M-dShow candidate documentation
VerticoType space-separated terms (orderless)
C-.Embark act on candidate
C-c C-eEmbark export to editable buffer
wgrepEdit grep results, then C-c C-c

Eglot / LSP

M-.Go to definition
M-,Go back
M-?Find references
M-'Find implementation
C-c l iFind implementation
C-c l tFind type definition
C-c l aCode actions
C-c l rRename symbol
C-c l fFormat buffer
C-c l dDoc buffer (eldoc)
C-c l oOrganize imports
s-mouse-1Click-jump to definition

Diagnostics & Spelling

M-n / M-pNext / previous flymake error
F8Toggle buffer diagnostics
S-F8Project diagnostics
M-$Correct word at point (flyspell)
M-TABFlyspell correct previous word
M-x compileCompile; jumps to first error

Project & Treemacs

C-x p pSwitch project → opens Dired (default)
C-x p p then f…find file instead
C-x p p then g…grep instead
C-c p lLock / unlock project root (custom)
C-x p fFind file in project
C-x p gGrep in project
C-x p bProject buffers (consult)
C-x p dDired in project root
C-x p DDired in a project subdirectory
C-x p kKill all project buffers
C-x p eEshell in project root
C-x p cCompile in project root
C-c t tToggle Treemacs
C-c t fFocus tree on current file
In tree: RETOpen node
In tree: cf / cdCreate file / directory
In tree: R / dRename / delete

Dired — Navigate & Mark

C-x dOpen Dired (prompts for dir)
C-x C-jDired at current file (dired-jump)
RET / fOpen file or directory
o / C-oOpen in other window / display only
^Go to parent directory
iInsert subdirectory inline
gRefresh listing
qQuit window
m / uMark / unmark file
UUnmark all
tToggle all marks
* %Mark by regexp
* .Mark by extension
sToggle sort: name / date
(Toggle detailed listing

Dired — Create, Move & Delete

+Create new directory
C-x C-fCreate new file (just save a new name)
CCopy file(s) — prompts for dest
RRename or move file(s)
dFlag for deletion (marks with D)
xExecute deletions of flagged files
DDelete immediately (with confirm)
~Flag all backup files (~)
S / HSymlink / hardlink
MChange file mode (chmod)
ZCompress / uncompress
! / &Shell command on file, sync / async
C-x C-qwdired — edit names as text
in wdired C-c C-cCommit renames
in wdired C-c C-kAbort renames

Magit & Diff

C-x gMagit status
s / uStage / unstage at point
S / UStage all / unstage all
c cCommit (C-c C-c to confirm)
c aAmend commit
P p / F pPush / pull
b b / b cCheckout / create branch
l lLog current branch
d dDiff
r iInteractive rebase
z z / z pStash / pop stash
TAB / qExpand section / quit
diff-hlFringe marks show uncommitted changes

Org Mode

C-c aOrg agenda
C-c cOrg capture
C-c c bCapture: Backlog item
C-c c iCapture: Interrupt task
C-c c lCapture: Learning
TAB / S-TABCycle heading / global visibility
C-c C-tCycle TODO state
C-c C-s / C-c C-dSchedule / deadline
C-c C-x C-iClock in
C-c C-x C-oClock out
M-↑ / M-↓Move subtree up / down
M-RETNew heading / list item
C-c C-rVerb command map (HTTP requests)

Registers, Macros & Misc

F6Load register (consult)
C-F6Store to register
M-F6Browse registers
C-x ( / C-x )Start / end keyboard macro
C-x eRun last macro (repeat with e)
C-x dDired
M-x world-clockStockholm time
M-x ediff-buffersSide-by-side diff
Markdown M-↑/↓Move block up / down

No shortcuts match that search.