doom

Table of Contents

1. doom

1.1. Metadata

1.1.1. Tags

  • :use: → things I use everyday
  • :essential: → things that are rather essential to my workflow
  • :new: → things y want to try/use more often
  • :custom: → things I have defined with a custom function (not including custom keybindings)

1.2. SPC

1.2.1. SPC: find file

1.2.2. , switch buffer (current buffers)

1.2.3. . browse files   use

1.2.4. : M-x   use

Evaluate any command that is interactive, i.e., it’s meant to be called by the user

1.2.5. ; evaluate (EX)   use

Evaulate emacs lisp code

1.2.6. < switch buffer (list of history buffers)   new

1.2.7. ` switch to last buffer

1.2.8. u universal arg (C-u)

1.2.9. x pop up scratch   new

1.2.10. ~ toggle last popup   use

1.2.11. h help   essential

Documentation about everything that has a docstring

1.2.11.1. v describe variable
1.2.11.2. f describe function
1.2.11.3. b describe (key)bindings

1.2.12. TAB workspace   essential

Open different files and cycle through them, as tabs

1.2.12.1. TAB Display tab bar
1.2.12.2. . switch workspace
1.2.12.3. 0 last workspace
1.2.12.4. 1-9 : x workspace   use
1.2.12.5. L load session   new
1.2.12.6. S autosave current session   new
1.2.12.7. X delete sessions
1.2.12.8. [ previous workspace   use
1.2.12.9. ] next workspace   use
1.2.12.10. n new workspace   use
1.2.12.11. d delete workspace   use
1.2.12.12. l load workspace from file   new
1.2.12.13. s save workspace to file   new
1.2.12.14. x kill all buffers’

1.2.13. m org-mode   essential

1.2.13.1. . helm-org-in-buffer-headings

Search through current buffer headings

1.2.13.2. / helm-org-agenda-files-headings

Search through all agenda files settings

1.2.13.3. t todo SPC-m-t modify TODO status
1.2.13.4. h make heading SPC-m-h org-toggle-heading
1.2.13.5. i make item SPC-m-i org-toggle-item
1.2.13.6. n org-store-link SPC-m-n
1.2.13.7. p modify priority SPC-m-p org-priority
1.2.13.8. d date SPC-m-d- make date
  1. s schedule SPC-m-d-s make date schedule
  2. d deadline SPC-m-d-d make date deadline
1.2.13.9. q counsel-org-tags

Set tags of the current headline, autocompleting with tags of the current file
To delete a tag, select it again

1.2.13.10. l links
  1. t toggle-link-display (see the link syntax)
  2. l org-insert-link
    • Copy a link to a headline with n org-store-link SPC-m-n
    • Also inserts with auto-completion by id or by file!
      • In the autocomplete window, select type file: RET or id: RET
1.2.13.11. j org-journal-new-entry
1.2.13.12. [ previous link (org-mark-ring-goto)
1.2.13.13. s subtree
  1. n narrow to subtree
  2. N widen
  3. s org-sparse-tree   essential

    Show only the headlines that match an org-agenda query
    https://orgmode.org/manual/Sparse-Trees.html

  4. r org-refile   essential

1.2.14. n org-mode-bis   essential

1.2.14.1. n org-capture
1.2.14.2. a org-agenda

It deserves it own section

1.2.14.3. m org-tags-view

Search by tag or by more complicated queries
By default choose between single tags, manually select the [?] <query> to execute a query

1.2.14.4. r org-rifle and search
  1. g helm-rg
  2. r helm-org-rifle
  3. d helm-org-rifle-directories
  4. o helm-org-rifle-occur

1.2.15. r org-roam   essential

org-roam web is changing at a neck-breaking pace, so links may be broken after a few months. Go to https://orgroam.com or https://github.com/org-roam/org-roam/, then find the current documentation website and hopefully you can guess where the old links were pointing to.

1.2.15.1. Lazy link creation

Typing roam\:mynewfile (without the backslash) creates a link that when open will trigger an org-roam-capture

1.2.15.2. c org-roam-capture   essential

Quickly capture a note by the templates defined in org-roam-capture-templates
Type a new note name to create it

1.2.15.3. g org-roam-graph

Open a graph showing the links between your org-roam files, which will be defined by your org-roam-directory

1.2.15.4. o org-roam (toggle buffer)   essential

Open the org-roam buffer, which shows backlinks from the current .org file (if it is an org-roam file)

1.2.15.5. i org-roam-insert   essential

Insert a link to an org-roam file by typing its name, using autocompletion

1.2.15.6. u org-roam-unlinked-references

List unlinked references, i.e. if the note is called GTD search across all org-roam notes the word “GTD”
It uses ripgrep, which has a complicated setup, as apt install ripgrep may not be compiled with the PCRE2 flag. After installing the .deb file, apt may silenty replace your version with the version from the repos, so you have to pin your locally installed version

1.2.15.7. v my/org-follow-link-vsplit   custom
1.2.15.8. j org-roam-open-buffer-at-bottom   custom
1.2.15.9. f refile   essential custom

Some custom refile functions

  1. l link and refile

    Refile a heading to a new file using org-roam-capture

  2. c refile to capture

    Refile a heading to a new file using org-roam-capture

  3. b link and refile to capture

    Replace a heading with a link and refile to a new file using org-roam-capture

1.2.15.10. h headline   custom
  1. o backlinks

    show backlinks of that particular headline

  2. u unlinked-references

    show unlinked references of that particular headline

1.2.15.11. t sparse-tree   custom
  1. j

    All TODOs including MAYBE, SOMEDAY, and :idea:

  2. k

    All TODOs including MAYBE, SOMEDAY, but not :idea:

  3. l

    All TODOs excluding MAYBE, SOMEDAY

1.2.16. j org-journal   custom

When creating a new org-journal entry, emacs switches to org-journal mode in which some keybindings such as org-sparse-tree won’t work. To switch between org-journal-mode and org-mode to get access to 2 different types of keyboard shorcuts I create 2 keybindings: SPC j m and SPC o m (which technically shouldn’t be in this subtree)

1.2.16.1. m set org-journal-mode
1.2.16.2. SPC o m → set org-mode
1.2.16.3. w/i/j

Org journal allows only one journal.
Set journal to one of these: work, journal, introspection

1.2.16.4. n,p

org-journal next/previous -entry

1.2.17. b buffer

1.2.17.1. B switch buffer
1.2.17.2. S sudo edit
1.2.17.3. [ prev
1.2.17.4. ] next
1.2.17.5. b switch ws buffer
1.2.17.6. k kill buffer
1.2.17.7. n new empty buffer
1.2.17.8. o kill other buffers
1.2.17.9. s save buffer
1.2.17.10. x pop scratch buffer
1.2.17.11. z burry buffer

1.2.18. c code

1.2.18.1. d jump to def
1.2.18.2. D jump to ref
1.2.18.3. e evaluate buffer
1.2.18.4. E evaluate and replace
1.2.18.5. b build
1.2.18.6. r repl
1.2.18.7. x list errors

1.2.19. f file   essential

Pretty much all I use is SPC f .

1.2.19.1. . find file   essential
1.2.19.2. / find file in project
1.2.19.3. > sudo find file
1.2.19.4. ? find file from here
1.2.19.5. E Browse emacs.d
1.2.19.6. P browse private config
1.2.19.7. R recent project files
1.2.19.8. a find other file
1.2.19.9. c open project editor config
1.2.19.10. d find dir
1.2.19.11. e find file in emacs.d
1.2.19.12. p find file in private config
1.2.19.13. r recent files
1.2.19.14. y yank filename
1.2.19.15. z search using fzf   custom

1.2.20. o open

1.2.20.1. b browser
1.2.20.2. o reveal in finder
1.2.20.3. r repl
1.2.20.4. t terminal

1.2.21. q quit   essential

1.2.21.1. q save and quit   essential
1.2.21.2. Q quit
1.2.21.3. l quit to last session

1.2.22. t toggle

1.2.22.1. F frame fullscreen
1.2.22.2. I indent (tabs/spaces)
1.2.22.3. b big mode (useful for presentations)
1.2.22.4. g evil goggles
1.2.22.5. l line numbers

1.2.23. w window

1.2.23.1. + increase height
1.2.23.2. - descr height
1.2.23.3. < dec width
1.2.23.4. = balance windows
1.2.23.5. > incr width
1.2.23.6. H move left
1.2.23.7. J move down
1.2.23.8. K move up
1.2.23.9. L move right
1.2.23.10. R rotate up
1.2.23.11. S split
1.2.23.12. W prev
1.2.23.13. _ set height
1.2.23.14. b bottom right
1.2.23.15. c close window
1.2.23.16. h,j,k,l
1.2.23.17. n new
1.2.23.18. o enlargen
1.2.23.19. p mru
1.2.23.20. q quit
1.2.23.21. r rotate down
1.2.23.22. s split
1.2.23.23. t top left
1.2.23.24. u winner undo
1.2.23.25. v vsplit
1.2.23.26. w next
1.2.23.27. | set width

1.3. [ prev

1.3.1. S spelling corr

1.3.2. [ text size

1.3.3. b buffer   essential

If it doesn’t work, try M-<

1.3.4. d diff

1.3.5. e error

1.3.6. h heading

1.3.7. s spelling error

1.3.8. t todo

1.3.9. w workspace

1.4. ] next

1.4.1. S spelling corr

1.4.2. [ text size

1.4.3. b buffer   essential

1.4.4. d diff

1.4.5. e error

1.4.6. h heading

1.4.7. s spelling error

1.4.8. t todo

1.4.9. w workspace

1.5. C-G to abort current operation

Useful when a process is blocking emacs

1.6. z

1.6.1. o/O open/open recursively

1.6.2. c/C close/close recursively

1.6.3. a alternate open-closed / alternate recursively

1.6.4. m/M close fold/close fold recursively

1.6.5. r/R open fold/open fold recursively

1.6.6. n narrow to subtree in a new indirect buffer

org-tree-to-indirect-buffer

1.6.7. vimish folds

1.6.7.1. f create fold (visual mode)
1.6.7.2. d/ delete/delete recursively
1.6.7.3. E Eliminate every fold (visual mode)

1.7. C-W

manage windows the vim way

1.7.1. h,j,k,l

1.7.2. s (horizontal) split

1.7.3. v vertical split

1.8. INSERT

https://www.nicholasvanhorn.com/posts/org-structure-completion.html

org-structure-template-alist
((a . export ascii) (c . center) (C . comment) (e . example) (E . export) (h . export html) (l . export latex) (q . quote) (s . src) (v . verse))

1.8.1. <s TAB

if True:
    print("Syntax highlighting")

1.8.2. <q TAB

Text in italics

1.8.3. <e TAB


1.8.4. <a TAB

1.8.5. <h TAB

1.8.6. <l TAB

1.8.7. <c TAB

1.8.8. <v TAB

1.9. M-, ⇔ C-o

Go back to previous link (even in the same file)

1.10. SPC-n-a Agenda mode

1.10.1. Q to exit when in agenda mode

1.10.2. a agenda

1.10.3. t TODO task description

1.11. pdf note taking

org-store-link works in a pdf

1.11.1. pdf-view-restore

https://github.com/007kevin/pdf-view-restore
Saves where you were in the previous session

1.11.2. pdf-tools

https://github.com/vedang/pdf-tools
pdf-occur and pdf-isearch supported

1.11.2.2. evil keybindings

https://github.com/emacs-evil/evil-collection/blob/master/modes/pdf/evil-collection-pdf.el

    (kbd "RET") 'image-next-line
    "j" 'evil-collection-pdf-view-next-line-or-next-page
    "k" 'evil-collection-pdf-view-previous-line-or-previous-page
    (kbd "SPC") 'pdf-view-scroll-up-or-next-page
    (kbd "S-SPC") 'pdf-view-scroll-down-or-previous-page
    (kbd "<delete>") 'pdf-view-scroll-down-or-previous-page
    (kbd "C-f") 'pdf-view-scroll-up-or-next-page
    (kbd "C-b") 'pdf-view-scroll-down-or-previous-page
    "]]" 'pdf-view-next-page-command
    "[[" 'pdf-view-previous-page-command
    (kbd "C-j") 'pdf-view-next-page-command
    (kbd "C-k") 'pdf-view-previous-page-command
    "gj" 'pdf-view-next-page-command
    "gk" 'pdf-view-previous-page-command
    (kbd "<next>") 'forward-page
    (kbd "<prior>") 'backward-page
    (kbd "<down>") 'evil-collection-pdf-view-next-line-or-next-page
    (kbd "<up>") 'evil-collection-pdf-view-previous-line-or-previous-page
    "gg" 'evil-collection-pdf-view-goto-first-page
    "G" 'evil-collection-pdf-view-goto-page

    ;; mark
    "'" 'pdf-view-jump-to-register
    "m" 'pdf-view-position-to-register

    ;; zoom
    "+" 'pdf-view-enlarge
    "zi" 'pdf-view-enlarge
    "=" 'pdf-view-enlarge
    "-" 'pdf-view-shrink
    "zo" 'pdf-view-shrink
    "0" 'pdf-view-scale-reset
    "z0" 'pdf-view-scale-reset

    "f" 'pdf-links-isearch-link
    "F" 'pdf-links-action-perform
    "h" 'image-backward-hscroll
    "^" 'image-bol
    "$" 'image-eol
    "l" 'image-forward-hscroll

    "H" 'pdf-view-fit-height-to-window ; evil-image has "H"
    "P" 'pdf-view-fit-page-to-window
    "W" 'pdf-view-fit-width-to-window ; evil-image has "W"

    ;; refresh
    "gr" 'revert-buffer

    (kbd "<C-down-mouse-1>") 'pdf-view-mouse-extend-region
    (kbd "<M-down-mouse-1>") 'pdf-view-mouse-set-region-rectangle
    (kbd "<down-mouse-1>")  'pdf-view-mouse-set-region

    (kbd "C-c C-c") 'docview-mode
    (kbd "C-c <tab>") 'pdf-view-extract-region-image

    "sb" 'pdf-view-set-slice-from-bounding-box
    "sm" 'pdf-view-set-slice-using-mouse
    "sr" 'pdf-view-reset-slice

    ;; goto
    "gl" 'pdf-view-goto-label

    ;; search
    (kbd "M-s o") 'pdf-occur ; TODO: More Evil bindings?

    "/" 'isearch-forward
    "?" 'isearch-backward
    "n" 'isearch-repeat-forward
    "N" 'isearch-repeat-backward

    "zd" 'pdf-view-dark-minor-mode
    "zm" 'pdf-view-midnight-minor-mode
    "zp" 'pdf-view-printer-minor-mode

    "o" 'pdf-outline

    ;; quit
    "q" 'quit-window
    "Q" 'kill-this-buffer
    "ZQ" 'kill-this-buffer
    "ZZ" 'quit-window)

1.11.3. org-pdftools

https://github.com/fuxialexander/org-pdftools
Implements links to pages and anotations (deep links)
https://www.youtube.com/watch?v=lCc3UoQku-E
Link format:
pdf:File.pdf::<page>++offset;annot-<page>-<number>

  • Click an annotation will take you to the heading
  • Click an org-pdftools link will take you to the annotation or location
  • Copy from org-mode to pdf with org-noter-pdftools-embed(-all)-note-to-pdf

1.11.4. pdf-continuous-scroll-mode

Continous scroll to prevent it from jumping from one page to another (a little bit unstable)

1.11.5. org-noter

https://github.com/weirdNox/org-noter
org-noter-create-skeleton (imports pdf outline and/or annotations!!) org-noter-pdftools has a (better) function called org-noter-pdf-tools-create-skeleton
org-noter-insert-(precise-)note -> Note linking to a page (page+offset within page)
org-noter-sync -> sync pdf and notes
https://www.youtube.com/watch?v=Un0ZRXTzufo

1.11.6. org-noter-pdftools

Scroll sync between org notes and pdf
org-noter-pdftools-create-skeleton

1.11.7. Alternatives (untested)

Author: Julian Lopez Carballal

Created: 2025-02-08 Sat 02:21