complete-computing-environment/org-roam.org

97 lines
4.3 KiB
Org Mode

:PROPERTIES:
:ID: cce/org-roam
:END:
#+TITLE: org-roam
#+filetags: :CCE:Knowledge:Management:Emacs:Tool:
#+ARCOLOGY_KEY: cce/org-roam
#+ARCOLOGY_ALLOW_CRAWL: t
#+ARROYO_MODULE_WANTS: cce/org_mode_installation.org
#+ARROYO_MODULE_WANTS: cce/configure_packaging.org
#+ARROYO_MODULE_WANTS: cce/evil_mode.org
#+ARROYO_EMACS_MODULE: org-roam
#+ARROYO_HOME_MODULE: hm/org-roam.nix
#+PROPERTY: header-args :mkdirp yes :results none
#+PROPERTY: header-args:emacs-lisp :tangle org-roam.el
#+PROPERTY: header-args:yaml :tangle roles/endpoint/tasks/org-roam.yml
#+AUTO_TANGLE: t
[[https://github.com/jethrokuan/org-roam][org-roam]] repository on GitHub. Org Roam is [[id:db0dd652-aa4e-4c65-9856-502a17c9bc74][Roam Research]] in [[id:1fb8fb45-fac5-4449-a347-d55118bb377e][org-mode]] maybe. a [[id:knowledge_base][Knowledge Management]] [[id:a7420bb9-395f-4afa-92fb-8eaa0b8a4cd8][Tool]] for [[id:cce/emacs][Emacs]] [[id:1fb8fb45-fac5-4449-a347-d55118bb377e][org-mode]] in nonlinear [[id:4cc8c5fc-ece0-4a34-8bf8-8fd0ac626bb4][Zettelkasten]] fashion. It is for now the root of my personal [[id:knowledge_base][Knowledge Base]], the repository which feeds my [[id:1d917282-ecf4-4d4c-ba49-628cbb4bb8cc][Arcology]], where I develop thoughts and make plans, and where the [[id:cce/cce][CCE]] is developed. It is configured quite simply, with a keymap exposed to me on =<SPC>r= via Evil Leader. One of these days I'll build a cleaner abstraction defining these maps.
[[id:list_of_things_to_fund][List of Things to Fund]]
Rather than install org-roam with the system wide load-path, on systems with home-manager it's included through MELPA. To build from local checkout: =#+ARROYO_HOME_EPKGS: overrides/org-roam.nix= which injects this override in to [[id:arroyo/emacs][Arroyo Emacs]]'s package index:
#+begin_src nix :tangle ~/arroyo-nix/overrides/org-roam.nix
org-roam = epkgs.melpaPackages.org-roam.overrideAttrs(old: {
src = /home/rrix/Code/org-roam;
});
#+end_src
I unconditionally need sqlite3 installed in my [[id:cce/home-manager][home-manager]]:
#+begin_src nix :tangle ~/arroyo-nix/hm/org-roam.nix
{pkgs, ...}:
{
home.packages = [ pkgs.sqlite ];
}
#+end_src
My =org-roam= configuration is basically pedestrian, I can hit =<SPC>r= to get to the =org-roam-prefix-map= keymap below which includes all the sort of functions I would want to perform on a node or to browse to a new one. Pressing =M-.= in insert mode will allow me to quickly link to any roam node.
#+begin_src emacs-lisp
; (use-package emacsql-sqlite3)
(use-package buttercup)
(defun cce/org-roam-mode-hook ()
(setq-local completion-at-point-functions
(delq 'tags-completion-at-point-function completion-at-point-functions)))
(use-package org-roam
:hook
(org-mode . cce/org-roam-mode-hook)
:init
(setq org-roam-v2-ack t)
(setq org-roam-directory (expand-file-name "~/org/"))
:config
(setq org-roam-directory (expand-file-name "~/org/"))
(setq org-roam-link-title-format "%s")
(add-to-list #'org-roam-mode-sections #'org-roam-unlinked-references-section)
(org-roam-db-autosync-mode)
:bind (:map evil-leader--default-map :prefix "r" :prefix-map org-roam-prefix-map
("aa" . org-roam-alias-add)
("ar" . org-roam-alias-remove)
("ka" . org-roam-ref-add)
("kr" . org-roam-ref-remove)
("Ta" . org-roam-tag-add)
("Tr" . org-roam-tag-remove)
("f" . org-roam-node-find)
("g" . org-roam-show-graph)
("i" . org-roam-node-insert)
("K" . org-roam-ref-find)
("l" . org-roam-buffer-toggle)
("L" . org-roam-buffer-display-dedicated)
("r" . org-roam-node-random))
:bind (:map evil-insert-state-map
("M-." . org-roam-node-insert)
("C-c r" . org-roam-node-insert)))
#+end_src
I have a lot of work still to expand upon this, but for now I just use the defaults. These are not included in my configuration:
#+begin_src emacs-lisp :tangle no
(setq org-roam-capture-templates '())
(add-to-list 'org-roam-capture-templates
'("d" "default" plain #'org-roam--capture-get-point
"%?"
:file-name "${slug}"
:head "#+TITLE: ${title}\n"
:unnarrowed t))
#+end_src
#+begin_src emacs-lisp
(provide 'cce/org-roam)
#+end_src