From 7cb66c68d5f51b837c7cd3fb1ea8e37009bc73fd Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Tue, 5 Oct 2021 11:09:05 -0400 Subject: [PATCH] Update to org-roam v2 --- emacs/.emacs.d/config/init-org.el | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/emacs/.emacs.d/config/init-org.el b/emacs/.emacs.d/config/init-org.el index b711c58..db39183 100644 --- a/emacs/.emacs.d/config/init-org.el +++ b/emacs/.emacs.d/config/init-org.el @@ -117,21 +117,24 @@ ;; org-roam provides backlinks between org documents (use-package org-roam - :hook (org-mode . org-roam-mode) + :hook ((org-mode . org-roam-db-autosync-mode)) :custom (org-roam-directory "~/org") - :bind (:map org-roam-mode-map - (("C-c n l" . org-roam) - ("C-c n f" . org-roam-find-file) - ("C-c n g" . org-roam-graph)) - :map org-mode-map - (("C-c n i" . org-roam-insert)) - (("C-c n I" . org-roam-insert-immediate))) + (org-roam-list-files-commands '(rg find fd fdfind)) + :init + (setq org-roam-v2-ack t) + (defvar org-roam-commands-map (make-sparse-keymap)) + (general-def org-roam-commands-map + "l" #'org-roam-buffer-toggle + "f" #'org-roam-node-find + "i" #'org-roam-node-insert + "I" #'org-roam-node-insert-immediate) + (with-eval-after-load 'org + (general-def org-mode-map "C-c n" org-roam-commands-map) + (which-key-declare-prefixes-for-mode 'org-mode "C-c n" "org-roam")) :general - (leader-map "of" #'org-roam-find-file) + (leader-map "of" #'org-roam-node-find) :config - (general-def org-roam-mode-map "C-c n" '(nil :which-key "org-roam")) - (general-def org-mode-map "C-c n" '(nil :which-key "org-roam")) (general-def 'normal org-roam-backlinks-mode-map "RET" #'org-open-at-point "q" #'bury-buffer))