Doom Emacs
Homepage / Notes / Computer Science / Text editors / Emacs / Doom Emacs
Official repo: https://github.com/hlissner/doom-emacs
Navigation
C-norC-jnextC-porC-kprevious
Buffers
Doom-esque commands:
SPC b d/kkill current bufferSPC b nnext bufferSPC b borSPC ,list buffers in this workspaceSPC b BorSPC <list buffers across workspacesSPC b Ncreates new bufferSPC b ishow 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 assbut 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 ssearch buffer/current fileSPC s porSPC /search entire project
Windows
C-w and SPC w interchangeable
vim-esque commands:
C-w vvertical splitC-w shorizontal splitC-w hjklfor movementsC-w wfor next windowC-w =to have an equal splitC-w qto quit window
Doom-esque commands:
SPC w m mmaximize 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:
gtgo to next workspacegTgo to previous workspace
Doom-esque commands:
SPC TAB 1go to workspace #1SPC TAB nnew workspaceSPC TAB rrename workspaceSPC TAB ddelete workspaceSPC TAB ...other
Terminals
Eshell
SPC o Eopen terminal in current windowSPC o etoggle in small bottom window
Vterm
SPC o Topen terminal in current window:vtermorSPC o topen terminal in new bottom window
Projects
(Using projectile)
SPC p pto open projectsSPC p tlist all todo for projectSPC p xproject-specific scratch buffer
Dired
-to go to parent directory+create new directorymto mark files/dirRto rename file (this includes moving to a new directory)dto delete, thenxto execute
Magit
A git client for Emacs!
SPC g gmagit statusTABto see more info,TABagain to seediff?to see keybindingsb(branch) to checkoutsto stage file,uto unstage- (also works on single lines!)
cto commitpto pushrto rebasexto 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 yto 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-addto add a breakpointM-x dap-breakpoint-log-messageto add a log messageM-x dap-debug(orSPC o d) to start debuggingM-x dap-hydrashows 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-replto start a REPL within that debugging stateM-x dap-tooltip-at-pointto 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)
zgto +spell/add-wordzwto +spell/remove-word
csv-mode
SPC m ato align fields (have the CSV be displayed table/spreadsheet-style)SPC m uto reverse above (unalign)SPC m sto sort fieldsSPC m kto delete a columnSPC m tto 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