<N>doom-emacs-guide.orgA beginner's field guideDoom One · Doom One Light · Plain dark
Doom Emacs, taken apart
Doom is a configuration framework for GNU Emacs: Vim's keys through evil, a menu of
ready-made modules, a fast startup, and a doom command-line tool to keep it all in sync.
Four ideas cover almost everything a beginner trips over. Each one is built below as a small machine you can operate.
Click a machine, then type on your keyboard. To practise on the real thing as you read, open Doom beside the
lessons with the button at the bottom right.
00
Install
You need GNU Emacs 27.1–31.1 (31.1 recommended), git, ripgrep 11 or newer and, optionally, fd for faster file finding. Then clone Doom into Emacs's config directory and let it install itself:
git clone --depth 1 https://github.com/doomemacs/core ~/.config/emacs
~/.config/emacs/bin/doom install
The installer asks a few questions, creates your private config in ~/.config/doom
(or ~/.doom.d) and downloads every package your modules need. Put the doom tool on your path
so you can run it from anywhere:
export PATH="$HOME/.config/emacs/bin:$PATH" # in ~/.zshrc or ~/.bashrc
doom doctor # checks fonts, tools and versions
Doom moved: the project now lives at github.com/doomemacs/core, with modules in
doomemacs/modules. Older guides that clone doomemacs/doomemacs or ~/.emacs.d
still describe the same ideas.
Start Emacs and you land on the dashboard. Press SPC and wait a moment: a menu appears. That menu is section 02. First, the thing that makes Doom feel strange: modes.
01
Modes: keys that mean different things
In most editors every key types a letter. In Doom (through evil, a faithful Vim emulation) the keyboard has states. In Normal state, the one you start in, keys are commands: w jumps a word, d deletes. In Insert state keys type text, as you're used to. In Visual state motions grow a selection. ESC (or C-g) always brings you back to Normal. When in doubt, press it.
Normal-state commands form a small grammar: operator + optional count + motion. dw deletes to the next word, ciw changes the word under the cursor, yy copies a line, 3j moves three lines down. Learn ten motions and three operators and you have hundreds of commands.
Try it on the machine
- Click the machine, press w a few times. The cursor shoe hops from word to word; nothing is typed.
- Press i. The lever drops to I, the shoe becomes a thin blade, and now letters are set into the line.
- Press ESC, then ved: select to the end of a word and delete it into the hell box. u brings it back.
Getting into Insert
| Keys | What it does |
|---|---|
| i | insert before the cursor |
| a | append after the cursor |
| IA | insert at line start / end |
| oO | open a new line below / above |
| ESCorC-g | back to Normal |
Moving (motions)
| Keys | What it does |
|---|---|
| hjkl | left, down, up, right |
| wbe | next word, back a word, word end |
| 0^$ | line start, first character, line end |
| ggG | top / bottom of the buffer |
| f{c}t{c} | jump to / just before character c |
| /textnN | search, next match, previous match |
Operators and friends
| Keys | What it does |
|---|---|
| dcy | delete, change, yank (copy), plus a motion |
| ddccyy | the same, on the whole line |
| xp | delete a character, paste |
| uC-r | undo, redo |
| . | repeat the last change |
| gc | comment (gcc a line, gcip a paragraph) |
Text objects and Visual
| Keys | What it does |
|---|---|
| iwaw | inner word / a word with its space |
| i"i(ip | inside quotes, parens, paragraph |
| ifiaig | Doom extras: function, argument, whole buffer |
| vVC-v | visual by character, line, block |
| :w:q | save; close the window (Ex commands) |
02
The leader key: every command is a path
Doom puts its commands behind one key, the leader: SPC in Normal state (M-SPC while you're in Insert state). After SPC you type a short mnemonic path: SPCff is file → find file, SPCbk is buffer → kill, SPCwv is window → vertical split. If you pause midway, which-key pops up a menu of every branch from where you are, so you only ever need to remember one level at a time. ESC abandons a half-typed path. SPCm is the local leader, with commands for the kind of file you're in (Org, Python…).
Try it on the machine
- Click, then press SPC. A ball drops to the first junction and the board lists the top-level branches.
- Press f. The gate throws, the ball rolls on and waits, and the board flips to the +file commands.
- Press f again: the ball lands in find-file. Try SPCfz to see an unbound path rejected.
One keystroke after SPC
| Keys | What it does |
|---|---|
| SPCSPC | find a file in this project |
| SPC. | find a file anywhere |
| SPC, | switch buffer |
| SPC/ | search the project (ripgrep) |
| SPC: | M-x: run any command by name |
| SPCx | toggle a scratch buffer |
The prefixes
| Prefix | Branch |
|---|---|
| SPCf | +file: find, recent, save, rename |
| SPCb | +buffer: switch, kill, next, previous |
| SPCw | +window: split, move, close |
| SPCp | +project: switch project, find in project |
| SPCs | +search: buffer, project, symbol |
| SPCg | +git: magit status, blame, branch |
| SPCo | +open: terminal, sidebar, dired |
| SPCh | +help: describe key, function, variable |
| SPCq | +quit: quit, restart |
Lost? SPChk then any key tells you exactly what that key runs. SPC: finds any command by name and shows its key binding next to it, so the shortcuts teach themselves.
03
Buffers, windows and the frame
Three words cause most of the confusion. A buffer is text held in memory: usually a file you opened,
sometimes something else, like *scratch*, *Messages* or the *doom* dashboard.
A window is a view onto a buffer; split the screen and you have two windows, which may show two buffers
or the same one twice. The frame is what your operating system calls a window: the whole Emacs box.
The consequences are the useful part. Closing a window loses nothing: the buffer is still open, one SPC, away. Killing a buffer removes the text from memory, and Doom asks first if there are unsaved changes. A file on disk only changes when you save.
Try it on the machine
- Click, then SPCbn: the active window's finger moves to the next slide in the tray.
- SPCwv splits the screen. A second finger appears, pointing at the same slide.
- SPCwc closes that window. Its finger parks, and every slide is still in the tray.
Buffers
| Keys | What it does |
|---|---|
| SPC, | switch buffer (this workspace) |
| SPCbn | next buffer |
| SPCbp | previous buffer |
| SPCbk | kill this buffer |
| SPCbs | save this buffer |
| SPCbN | new empty buffer |
| SPC` | jump back to the last buffer |
Windows
| Keys | What it does |
|---|---|
| SPCwv | split side by side |
| SPCws | split stacked |
| SPCwhorSPCwl | move to the window left / right (j k: down / up) |
| SPCww | next window |
| SPCwc | close this window |
| SPCwmm | maximize this window |
| SPCw= | make windows equal size |
Two more containers sit around these. A project is any folder under version control: SPCpp switches project, SPCSPC finds a file inside it and SPC/ searches it. A workspace (SPCTAB) is a named set of buffers and window layouts, like a browser tab group, so each project keeps its own buffer list. Pop-ups such as the terminal (SPCot) are ordinary windows that Doom places and closes for you.
04
Config and doom sync
Everything that is yours lives in three files in ~/.config/doom (open them with
SPCfP). Doom's own code in ~/.config/emacs is never edited by hand.
init.el: which modules are on
A single doom! block lists the modules you want, grouped by category. Uncomment a line to turn a
module on; add +flags for its options. Put the cursor on a module and press K for its documentation.
(doom! :completion
(corfu +orderless)
vertico
:ui
doom dashboard modeline workspaces
:editor
(evil +everywhere)
:tools
magit lsp
:lang
emacs-lisp org
(python +lsp))packages.el: extra packages
For anything not covered by a module. Declare it here; Doom fetches and pins it on the next sync.
(package! beacon) ; from MELPA
(package! some-mode
:recipe (:host github :repo "you/some-mode"))
(package! evil-snipe :disable t) ; turn off one Doom shipsconfig.el: your settings
Plain Emacs Lisp, run at startup. Settings for a package go inside with-eval-after-load so Doom's
defaults don't overwrite them.
(setq doom-theme 'doom-one
doom-font (font-spec :family "JetBrains Mono" :size 14)
display-line-numbers-type 'relative)
(with-eval-after-load 'org
(setq org-log-done 'time))
(map! :n "C-s" #'save-buffer) ; your own keyThe rule that saves the most confusion: Doom does not read init.el or packages.el
on its own. After editing either, run doom sync in a shell, then restart Emacs. It installs or removes
packages and rebuilds Doom's caches. config.el needs no sync, only a restart (SPCqr).
Try it on the machine
- Flip a module switch. The stale lamp lights: the running Emacs knows nothing about it yet.
- Press r to restart now. The screen reboots but the change is missing, because nothing was synced.
- Press s to sync, then r. Now it loads. Turn a
config.elknob and only a restart is needed.
| You changed… | Run | Then |
|---|---|---|
init.el (modules, flags) | doom sync | restart Emacs |
packages.el | doom sync | restart Emacs |
config.el | nothing | restart Emacs (SPCqr) |
| Emacs itself, or things feel broken | doom sync, then doom doctor | restart Emacs |
| You want the latest Doom | doom upgrade | restart Emacs |
05
Cheat sheet
Print this, or keep it in a buffer. Everything here is a default binding in a stock Doom install with
(evil +everywhere); SPCg needs the magit module and
SPCot and SPCop a terminal and a sidebar module.
Modes
- ESCorC-g
- back to Normal
- iao
- insert, append, new line
- vV
- visual char / line
- uC-r
- undo / redo
- .
- repeat last change
Move
- hjkl
- by character / line
- wbe
- by word
- 0$
- line start / end
- ggG
- buffer top / bottom
- /nN
- search, next, previous
Edit
- dwcw
- delete / change word
- ddyyp
- cut line, copy line, paste
- ciwci"
- change word, change in quotes
- gcc
- comment line
- x
- delete character
Files
- SPC.
- find file
- SPCfr
- recent files
- SPCfs
- save
- SPCfR
- rename / move
- SPCfP
- your Doom config
Buffers
- SPC,
- switch
- SPCbn
- next
- SPCbk
- kill
- SPC`
- last buffer
- SPCx
- scratch
Windows
- SPCwv
- split side by side
- SPCws
- split stacked
- SPCwl
- move right (h j k l)
- SPCwc
- close
- SPCwmm
- maximize
Projects & search
- SPCpp
- switch project
- SPCSPC
- find in project
- SPC/
- search project
- SPCss
- search buffer
- SPCsi
- jump to symbol
Git, open, help
- SPCgg
- magit status
- SPCot
- terminal popup
- SPCop
- project sidebar
- SPChk
- what does this key do?
- SPC:
- run any command
Shell
doom sync- after init.el / packages.el
doom doctor- diagnose problems
doom upgrade- update Doom
- SPCqr
- restart Emacs
- SPCqq
- quit Emacs
06
Your first week
- Day 1. Survive. Install, run
doom doctor, open a scratch buffer with SPCx. Practise i, typing, ESC, :w. Nothing else. - Day 2. Move without arrows. hjkl, wbe, 0$, ggG, and search with /.
- Day 3. Edit with verbs. d, c, y with motions and text objects; u and . constantly.
- Day 4. Follow the leader. Press SPC, read the menu, pick a branch. Open files with SPC. and SPCfr.
- Day 5. Projects. SPCpp into a repo, SPCSPC to find files, SPC/ to search, SPCgg for git.
- Day 6. Split the screen. SPCwv, SPCwl, SPC,. Close windows freely; your buffers stay open.
- Day 7. Make it yours. Set a font and theme in
config.el, enable one language module ininit.el, rundoom sync, restart.
Key bindings and file layouts on this page were checked against the Doom sources
(doomemacs/core and doomemacs/modules, October 2026). Modules can change bindings;
when in doubt, ask Doom: SPChk.
07
Real Doom, in this page
The machines above are models. This is the real thing: GNU Emacs 30.2 compiled to WebAssembly, running Doom
(evil, which-key, vertico, org, the dashboard) in a worker thread, with a terminal drawn by xterm.js. Your files
under ~ and your Doom config are saved in the browser's private file system (OPFS), so they survive a reload.
Nothing is installed and nothing leaves the tab.
Your home folder starts with a project to practise on: this guide's own source, in ~/emacs-learn.
Press SPCpp and pick it, then SPCSPC to jump to any of its files,
SPCss to search inside one, SPC, to switch buffers and
SPCwv to split. SPCop opens the file tree (treemacs):
jk to move, TAB to open a folder, RET to open a file. It is your copy: edits are saved in the browser. Delete the folder and reload
for a fresh one.
About 6 MB on first start. Click into the terminal and press SPC.
Doom is docked beside the lessons.
It needs a page served with cross-origin isolation (for SharedArrayBuffer). Opened as a file this
section can't start; run node wasm/web/serve.mjs in this project and open
http://localhost:8080/guide/. What doesn't work in a browser: anything that runs another program, such as
magit (no git), project search (no ripgrep), terminals and LSP. Restarting Emacs means reloading the page.