Spool Five

Org Roam

Org roam is a plain-text personal knowledge management system.

My current org roam settings [2022-06-04 Sat]

These settings are designed to work with Doom Emacs.

General Config

(use-package! org-roam
    :defer t
    :init
    (setq org-roam-v2-ack t)
    (setq org-roam-graph-viewer "/usr/bin/qutebrowser")
    :config
    (org-roam-setup))
(setq org-roam-completion-everywhere t)

Capture templates:

(after! org-roam
    (setq org-roam-capture-templates
    '(("d" "default" plain "#+created: %u\n#+filetags: %^G\n\n* ${title}\n%?"
    :target (file+head "rafts/%<%Y%m%d>-${slug}.org"
    "#+title: ${title}\n")
    :unnarrowed t
    :jump-to-captured t)
    ("e" "encrypted" plain "#+created: %u\n#+filetags: %^G\n\n* ${title}\n%?"
    :target (file+head "rafts/%<%Y%m%d>-${slug}.org.gpg"
    "#+title: ${title}\n")
    :unnarrowed t
    :jump-to-captured t)
    ("r" "reference" plain "#+created: %u\n#+filetags: ref: %^G\n\n* ${title}\n%?"
    :target (file+head "rafts/%<%Y%m%d>-${slug}.org"
    "#+title: ${title}\n")
    :unnarrowed t
    :jump-to-captured t)
    ("b" "box3" plain "#+created: %u\n#+filetags: %^G\n\n%?"
    :target (file+head "ref/org/%<%Y%m%d>-${slug}.org"
    "#+title: ${title}\n")
    :unnarrowed t )
    ("q" "quick" plain "#+created: %u\n#+filetags: %^G\n\n%?"
    :target (file+head "rafts/%<%Y%m%d>-${slug}.org"
    "#+title: ${title}\n")
    :unnarrowed t)))
    (setq org-roam-dailies-capture-templates
    '(("d" "default" entry "* %<%H:%M> -  [[id:477e986a-2fba-4982-8158-b309baf0b14b][%?]]"
    :target (file+head "%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>\n")))))

Immediate Capture

I’ve added this, which I found on the org roam github page, to allow for the “immediate” capture functionality that you find in things like Obsidian and Logseq. It allows you to just create/insert a reference to a new note without having to jump to that note. Sometimes, this is better when you want to maintain focus on the current note.

(defun my/org-roam-insert-no-capture ()
  (interactive)
  (let ((org-roam-capture-templates
	 (mapcar
	  #'(lambda (tmpl) (append tmpl '(:immediate-finish t)))
	  org-roam-capture-templates)))
    (funcall-interactively 'org-roam-node-insert)))

To be honest, I don’t use this as much as I would like to, and I need to revisit this config

(add-hook! 'org-roam-mode-hook (add-to-list 'display-buffer-alist
    '("\\*org-roam\\*"
    (display-buffer-in-side-window)
    (side . right)
    (slot . 0)
    (window-width . 0.33)
    (window-parameters . ((no-other-window . t)
    (no-delete-other-windows . t))))))

Keybindings

(map! :map org-roam-mode-map
    :leader
    :prefix "r"
    :desc "Find Note"         "r"     'org-roam-node-find
    :desc "Insert Note"       "i"     'org-roam-node-insert
    :desc "Insert immediate"  "m"     'my/org-roam-insert-no-capture
    :desc "Toggle Buffer"     "b"     'org-roam-buffer-toggle
    :desc "Add Tag"           "t"     'org-roam-tag-add
    :desc "Bibtex Link"       "c"     'orb-insert-link)
(map! :map org-roam-mode-map
    :leader
    :prefix "r d"
    :desc "Daily Capture"     "c"     'org-roam-dailies-capture-today
    :desc "Daily Find"        "f"     'org-roam-dailies-find-directory
    :desc "Daily Today"       "t"     'org-roam-dailies-find-today
    :desc "Daily Date"        "d"     'org-roam-dailies-goto-date)

Temporary fix for tag display

See issue here: github issue

(setq org-roam-node-display-template "${title:*} ${tags:30}") ;the format here is $(field-name:length). Including the 'length' integer causes the alignment of the tags to the right, ommitting it leaves them on the left.

Org-roam bibtex

(use-package! org-roam-bibtex
    :after org-roam
    :hook (org-roam-mode . org-roam-bibtex-mode)
    :config
    (require 'org-ref))

Links to this note

Random Note