refactor(org): org-roam config
- Remove redundant org-roam-mode-section-functions setting (same as its default value). - Remove redundant org-roam-db-location setting (same as its default value). - Fix redundant parentheses. - Add comment explaining turn-on-visual-line-mode hook.
This commit is contained in:
parent
dd33f57513
commit
ba662ea939
1 changed files with 35 additions and 41 deletions
|
@ -20,7 +20,6 @@ of org-mode to properly utilize ID links.")
|
||||||
;; for these variables. If not, default values will be set in the :config
|
;; for these variables. If not, default values will be set in the :config
|
||||||
;; section.
|
;; section.
|
||||||
(defvar org-roam-directory nil)
|
(defvar org-roam-directory nil)
|
||||||
(defvar org-roam-db-location nil)
|
|
||||||
|
|
||||||
:init
|
:init
|
||||||
(doom-load-packages-incrementally
|
(doom-load-packages-incrementally
|
||||||
|
@ -72,15 +71,9 @@ In case of failure, fail gracefully."
|
||||||
(expand-file-name org-directory)
|
(expand-file-name org-directory)
|
||||||
(file-truename)
|
(file-truename)
|
||||||
(file-name-as-directory))
|
(file-name-as-directory))
|
||||||
org-roam-db-location
|
|
||||||
(or org-roam-db-location
|
|
||||||
(concat doom-etc-dir "org-roam.db"))
|
|
||||||
org-roam-node-display-template
|
org-roam-node-display-template
|
||||||
"${doom-hierarchy:*} ${doom-tags:45}"
|
"${doom-hierarchy:*} ${doom-tags:45}"
|
||||||
org-roam-completion-everywhere t
|
org-roam-completion-everywhere t
|
||||||
org-roam-mode-section-functions
|
|
||||||
#'(org-roam-backlinks-section
|
|
||||||
org-roam-reflinks-section)
|
|
||||||
org-roam-db-gc-threshold most-positive-fixnum
|
org-roam-db-gc-threshold most-positive-fixnum
|
||||||
;; Reverse the default to favor faster searchers over slower ones.
|
;; Reverse the default to favor faster searchers over slower ones.
|
||||||
org-roam-list-files-commands '(fd fdfind rg find))
|
org-roam-list-files-commands '(fd fdfind rg find))
|
||||||
|
@ -107,42 +100,43 @@ In case of failure, fail gracefully."
|
||||||
("^\\*org-roam: " ; node dedicated org-roam buffer
|
("^\\*org-roam: " ; node dedicated org-roam buffer
|
||||||
:side right :width 0.33 :height 0.5 :ttl nil :modeline nil :quit nil :slot 2)))
|
:side right :width 0.33 :height 0.5 :ttl nil :modeline nil :quit nil :slot 2)))
|
||||||
|
|
||||||
|
;; Soft-wrap lines in the backlinks buffer
|
||||||
(add-hook 'org-roam-mode-hook #'turn-on-visual-line-mode)
|
(add-hook 'org-roam-mode-hook #'turn-on-visual-line-mode)
|
||||||
|
|
||||||
(map! (:map org-mode-map
|
(map! :map org-mode-map
|
||||||
:localleader
|
:localleader
|
||||||
:prefix ("m" . "org-roam")
|
:prefix ("m" . "org-roam")
|
||||||
"D" #'org-roam-demote-entire-buffer
|
"D" #'org-roam-demote-entire-buffer
|
||||||
"f" #'org-roam-node-find
|
"f" #'org-roam-node-find
|
||||||
"F" #'org-roam-ref-find
|
"F" #'org-roam-ref-find
|
||||||
"g" #'org-roam-graph
|
"g" #'org-roam-graph
|
||||||
"i" #'org-roam-node-insert
|
"i" #'org-roam-node-insert
|
||||||
"I" #'org-id-get-create
|
"I" #'org-id-get-create
|
||||||
"m" #'org-roam-buffer-toggle
|
"m" #'org-roam-buffer-toggle
|
||||||
"M" #'org-roam-buffer-display-dedicated
|
"M" #'org-roam-buffer-display-dedicated
|
||||||
"n" #'org-roam-capture
|
"n" #'org-roam-capture
|
||||||
"r" #'org-roam-refile
|
"r" #'org-roam-refile
|
||||||
"R" #'org-roam-link-replace-all
|
"R" #'org-roam-link-replace-all
|
||||||
(:prefix ("d" . "by date")
|
(:prefix ("d" . "by date")
|
||||||
:desc "Goto previous note" "b" #'org-roam-dailies-goto-previous-note
|
:desc "Goto previous note" "b" #'org-roam-dailies-goto-previous-note
|
||||||
:desc "Goto date" "d" #'org-roam-dailies-goto-date
|
:desc "Goto date" "d" #'org-roam-dailies-goto-date
|
||||||
:desc "Capture date" "D" #'org-roam-dailies-capture-date
|
:desc "Capture date" "D" #'org-roam-dailies-capture-date
|
||||||
:desc "Goto next note" "f" #'org-roam-dailies-goto-next-note
|
:desc "Goto next note" "f" #'org-roam-dailies-goto-next-note
|
||||||
:desc "Goto tomorrow" "m" #'org-roam-dailies-goto-tomorrow
|
:desc "Goto tomorrow" "m" #'org-roam-dailies-goto-tomorrow
|
||||||
:desc "Capture tomorrow" "M" #'org-roam-dailies-capture-tomorrow
|
:desc "Capture tomorrow" "M" #'org-roam-dailies-capture-tomorrow
|
||||||
:desc "Capture today" "n" #'org-roam-dailies-capture-today
|
:desc "Capture today" "n" #'org-roam-dailies-capture-today
|
||||||
:desc "Goto today" "t" #'org-roam-dailies-goto-today
|
:desc "Goto today" "t" #'org-roam-dailies-goto-today
|
||||||
:desc "Capture today" "T" #'org-roam-dailies-capture-today
|
:desc "Capture today" "T" #'org-roam-dailies-capture-today
|
||||||
:desc "Goto yesterday" "y" #'org-roam-dailies-goto-yesterday
|
:desc "Goto yesterday" "y" #'org-roam-dailies-goto-yesterday
|
||||||
:desc "Capture yesterday" "Y" #'org-roam-dailies-capture-yesterday
|
:desc "Capture yesterday" "Y" #'org-roam-dailies-capture-yesterday
|
||||||
:desc "Find directory" "-" #'org-roam-dailies-find-directory)
|
:desc "Find directory" "-" #'org-roam-dailies-find-directory)
|
||||||
(:prefix ("o" . "node properties")
|
(:prefix ("o" . "node properties")
|
||||||
"a" #'org-roam-alias-add
|
"a" #'org-roam-alias-add
|
||||||
"A" #'org-roam-alias-remove
|
"A" #'org-roam-alias-remove
|
||||||
"t" #'org-roam-tag-add
|
"t" #'org-roam-tag-add
|
||||||
"T" #'org-roam-tag-remove
|
"T" #'org-roam-tag-remove
|
||||||
"r" #'org-roam-ref-add
|
"r" #'org-roam-ref-add
|
||||||
"R" #'org-roam-ref-remove)))
|
"R" #'org-roam-ref-remove))
|
||||||
|
|
||||||
(when (featurep! :editor evil +everywhere)
|
(when (featurep! :editor evil +everywhere)
|
||||||
(add-hook! 'org-roam-mode-hook
|
(add-hook! 'org-roam-mode-hook
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue