Doom Emacs
Homepage / Notes / Computer Science / Text editors / Emacs / Doom Emacs
Official repo: https://github.com/hlissner/doom-emacs
Navigation
C-n
orC-j
nextC-p
orC-k
previous
Buffers
Doom
-esque commands:
SPC b d/k
kill current bufferSPC b n
next bufferSPC b b
orSPC ,
list buffers in this workspaceSPC b B
orSPC <
list buffers across workspacesSPC b N
creates new bufferSPC b i
show ibuffer interfaceSPC b ...
command suggestions
Text editing
evil-snipe
https://github.com/hlissner/evil-snipe
s [2 chars]
jump to next occurrence of[2 chars]
S [2 chars]
same ass
but backwards-looking
once occurrence is found, can jump to the next one with s
, previous with S
avy
https://github.com/abo-abo/avy
Similar to vim-easymotion
https://www.youtube.com/watch?v=zar4GsOBU0g&list=PLhXZp00uXBk4np17N39WvB80zgxlZfVwj&index=7
g s SPC [char]
jump to [char]g s s [2 chars]
jump to [2 chars]g s / [n chars]
jump to [n chars]
evil-multiedit
https://github.com/hlissner/evil-multiedit
M-d
select word under cursor
M-d M-d
select word under cursor and select next occurrence as well
M-d M-D
select word under cursor and select previous occurrence as well
after a visual-mode selection was more, R
to select all occurrences
after matches are highlighted, move between them with C-n
for next, C-p
for previous
RET
to exclude or include a match in the selection
Swiper
SPC s s
search buffer/current fileSPC s p
orSPC /
search entire project
Windows
C-w
and SPC w
interchangeable
vim
-esque commands:
C-w v
vertical splitC-w s
horizontal splitC-w hjkl
for movementsC-w w
for next windowC-w =
to have an equal splitC-w q
to quit window
Doom
-esque commands:
SPC w m m
maximize window (what I used vim-zoom for)SPC w ...
command suggestions
Workspaces
Official help: https://github.com/hlissner/doom-emacs/tree/master/modules/feature/workspaces
vim
-esque commands:
gt
go to next workspacegT
go to previous workspace
Doom
-esque commands:
SPC TAB 1
go to workspace #1SPC TAB n
new workspaceSPC TAB r
rename workspaceSPC TAB d
delete workspaceSPC TAB ...
other
Terminals
Eshell
SPC o E
open terminal in current windowSPC o e
toggle in small bottom window
Vterm
SPC o T
open terminal in current window:vterm
orSPC o t
open terminal in new bottom window
Projects
(Using projectile)
SPC p p
to open projectsSPC p t
list all todo for projectSPC p x
project-specific scratch buffer
Dired
-
to go to parent directory+
create new directorym
to mark files/dirR
to rename file (this includes moving to a new directory)d
to delete, thenx
to execute
Magit
A git
client for Emacs!
SPC g g
magit statusTAB
to see more info,TAB
again to seediff
?
to see keybindingsb
(branch) to checkouts
to stage file,u
to unstage- (also works on single lines!)
c
to commitp
to pushr
to rebasex
to discard
C-c C-c
or ZZ
or :wq
to exit commit edit mode
Forge
Work with Git forges, such as Github and Gitlab, from the comfort of Magit and the rest of Emacs.
Setup
Create a .authinfo.gpg
file (Emacs seamlessly encrypts and decrypts .gpg
files!) in the home directory with this info (for GitHub): machine api.github.com login {username}^forge password {token}
Usage
@
to open Forge menuf y
to pull
Deft
SPC n d
open Deft UI
Snippets
https://github.com/hlissner/doom-snippets
Flycheck
On-the-fly syntax checking
SPC c x
show error list for current buffer
dap-mode
A debugger using lsp-mode
M-x dap-breakpoint-add
to add a breakpointM-x dap-breakpoint-log-message
to add a log messageM-x dap-debug
(orSPC o d
) to start debuggingM-x dap-hydra
shows handy keybindingsM-x dap-ui-expressions-add-prompt
(orSPC m d
) to add new expressions (specific values we want to watch)M-x dap-ui-repl
to start a REPL within that debugging stateM-x dap-tooltip-at-point
to see the value of a variable
Eval
SPC c e
to evaluate buffer / region and display result in an overlay
File Templates
https://github.com/hlissner/doom-emacs/issues/2134
Spell checkers (aspell)
zg
to +spell/add-wordzw
to +spell/remove-word
csv-mode
SPC m a
to align fields (have the CSV be displayed table/spreadsheet-style)SPC m u
to reverse above (unalign)SPC m s
to sort fieldsSPC m k
to delete a columnSPC m t
to transpose file
Resources
Emacs Doom Episode 1 - Getting Started: https://www.youtube.com/watch?app=desktop&v=rCMh7srOqvw&list=PLhXZp00uXBk4np17N39WvB80zgxlZfVwj&index=2&t=0s
Commentary around config: https://zzamboni.org/post/my-doom-emacs-configuration-with-commentary/
Commentary around config #2: https://tecosaur.github.io/emacs-config/config.html
Google Calendar and org-mode
: https://cestlaz.github.io/posts/using-emacs-26-gcal