doomemacs/modules/lang/org/contrib/roam.el

42 lines
1.2 KiB
EmacsLisp
Raw Normal View History

;;; lang/org/contrib/roam.el -*- lexical-binding: t; -*-
;;;###if (featurep! +roam)
(use-package! org-roam
:commands (org-roam
org-roam-insert
org-roam-find-file
org-roam-switch-to-buffer
org-roam-graph-show)
2020-04-01 14:51:12 -04:00
:preface
;; Set this to nil so we can later detect whether the user has set a custom
;; directory for it, and default to `org-directory' if they haven't.
(defvar org-roam-directory nil)
:init
(map! :after org
:map org-mode-map
:localleader
:prefix ("m" . "org-roam")
"m" #'org-roam
"i" #'org-roam-insert
"b" #'org-roam-switch-to-buffer
"f" #'org-roam-find-file
"g" #'org-roam-graph-show
"i" #'org-roam-insert)
:config
2020-04-01 14:51:12 -04:00
(unless org-roam-directory
(setq org-roam-directory org-directory))
(org-roam-mode +1))
;; Since the org module lazy loads org-protocol (waits until an org URL is
;; detected), we can safely chain `org-roam-protocol' to it.
(use-package! org-roam-protocol
:after org-protocol)
(use-package! company-org-roam
:when (featurep! :completion company)
:after org-roam
:config
(set-company-backend! 'org-mode '(company-org-roam company-yasnippet company-dabbrev)))