config/doom: improve org-roam node search

This commit is contained in:
xeruf 2022-12-22 17:25:29 +01:00
parent f7888ec460
commit 728d845b0e
3 changed files with 20 additions and 1 deletions

View File

@ -2,3 +2,4 @@ local.el
user.el
custom.el
user.el
theme.el

View File

@ -549,6 +549,25 @@ Version 2019-11-04 2021-02-16"
(when (equal major-mode 'org-mode) (org-mode-restart)))
(if (file-exists-p org-roam-directory) (xf/auto-org-roam-db-sync-mode))
;; Node Search
(setq org-roam-node-display-template
#("${doom-hierarchy:*} ${doom-type:7} ${doom-tags:30}" 20 35
(face font-lock-keyword-face)
28 40
(face org-tag)
))
;; REVIEW Remove when addressed upstream. See org-roam/org-roam#2066.
(defun my/org-roam-node-read--to-candidate (node template)
"Return a minibuffer completion candidate given NODE.
TEMPLATE is the processed template used to format the entry."
(let ((candidate-main (org-roam-node--format-entry
template
node
(1- (frame-width)))))
(cons (propertize candidate-main 'node node) node)))
(advice-add 'org-roam-node-read--to-candidate :override #'my/org-roam-node-read--to-candidate)
)
(use-package! ox

View File

@ -1 +0,0 @@
theme.el##default