Emacs Cheat Sheet

Key Notation

Examples:
C-a → Ctrl + a
C-x o → Ctrl + x, then o

Basics

KeysDescription
C-x C-cQuit Emacs
C-gCancel command
C-x C-sSave buffer
C-x bSwitch buffer
C-x kKill buffer
C-x C-fOpen file
C-/ or C-_Undo
C-x uUndo (alt)

Movement

Buffer/File

KeysDescription
M-<Beginning of buffer
M->End of buffer
C-vPage down
M-vPage up
C-lCenter screen

Lines

KeysDescription
C-aBeginning of line
C-eEnd of line
C-nNext line
C-pPrevious line
M-g gGo to line

Words, Characters & Sentences

KeysDescription
M-fForward word
M-bBackward word
C-fForward char
C-bBackward char
M-aPrevious sentence
M-eNext sentence

Searching

KeysDescription
C-sIncremental search forward
C-rIncremental search backward
M-%Search and replace

Kill Ring (Copy/Cut/Paste)

KeysDescription
C-SPCSet mark (select region)
M-wCopy region
C-wCut region
C-yYank (paste)
M-yCycle through kill ring
M-dKill word forward
M-DELKill word backward
C-kKill line

Editing & Formatting

KeysDescription
TabIndent line
C-jNew line + indent
M-|Delete spaces/tabs around point
C-dDelete next char
DELDelete previous char
C-tSwap characters
M-uUppercase word
M-lLowercase word
C-u n charInsert n copies of char

Rectangle mode: C-x SPC → select, C-x r t → insert

Help

KeysDescription
C-h kDescribe keybinding
C-h fDescribe function
C-h mDescribe mode
C-h vDescribe variable
describe-charDescribe character
describe-faceDescribe face/theme

Windows/Frames

KeysDescription
C-x oSwitch window
C-x 1Close other windows
C-x 2Split horizontally
C-x 3Split vertically
C-x 0Close current window

Packages & Plugins

Cider (Clojure)

KeysDescription
C-c M-n M-nSwitch namespace
C-x C-eEval expression
C-c C-kCompile buffer
C-c C-d C-dShow doc for symbol
M-. / M-,Jump to source / back
C-c C-d C-aApropos search
M-x cider-jack-inStart REPL
C-c C-x C-j C-jAlt start REPL
C-↑ / C-↓Cycle REPL history
C-RETClose parens + eval

Paredit

KeysDescription
M-x paredit-modeToggle mode
M-(Wrap in parentheses
C-→Slurp (expand parens)
C-←Barf (shrink parens)
C-M-f / C-M-bMove to paren

Evil Mode (Vim-style)

KeysDescription
h j k lCursor navigation
SPC w h/j/k/lMove to window
SPC w H/J/K/LMove window
C-x 3Split right
SPC w v/VVertical split
g ; / g ,Goto last change

Doom Emacs

KeysDescription
C-gEscape
SPC j jJump to word
SPC SPC / SPC p pSwitch project
SPC p aAdd project
SPC f fFind file
SPC b bBuffer list
SPC h tToggle theme
SPC c xShow diagnostics
C-u C-x =Cursor position

Workflows

References