2020-03-29 18:48:23 -04:00
|
|
|
;;; lang/org/contrib/roam.el -*- lexical-binding: t; -*-
|
|
|
|
;;;###if (featurep! +roam)
|
|
|
|
|
|
|
|
(use-package! org-roam
|
2020-04-08 21:24:49 +01:00
|
|
|
:hook (org-load . org-roam-mode)
|
2020-04-13 19:30:31 +02:00
|
|
|
:hook (org-roam-backlinks-mode . turn-on-visual-line-mode)
|
2020-04-16 15:16:06 -04:00
|
|
|
:commands (org-roam-buffer-toggle-display
|
2020-04-08 21:24:49 +01:00
|
|
|
org-roam-find-file
|
|
|
|
org-roam-graph-show
|
|
|
|
org-roam-insert
|
|
|
|
org-roam-switch-to-buffer
|
2020-04-17 14:05:15 -04:00
|
|
|
org-roam-dailies-date
|
|
|
|
org-roam-dailies-today
|
|
|
|
org-roam-dailies-tomorrow
|
|
|
|
org-roam-dailies-yesterday)
|
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)
|
2020-03-29 18:48:23 -04:00
|
|
|
:init
|
|
|
|
(map! :after org
|
|
|
|
:map org-mode-map
|
|
|
|
:localleader
|
|
|
|
:prefix ("m" . "org-roam")
|
|
|
|
"b" #'org-roam-switch-to-buffer
|
|
|
|
"f" #'org-roam-find-file
|
2020-03-30 03:14:01 -04:00
|
|
|
"g" #'org-roam-graph-show
|
2020-04-01 17:26:37 -04:00
|
|
|
"i" #'org-roam-insert
|
|
|
|
"m" #'org-roam
|
|
|
|
(:prefix ("d" . "by date")
|
2020-04-17 14:05:15 -04:00
|
|
|
:desc "Arbitrary date" "d" #'org-roam-dailies-date
|
|
|
|
:desc "Today" "t" #'org-roam-dailies-today
|
|
|
|
:desc "Tomorrow" "m" #'org-roam-dailies-tomorrow
|
|
|
|
:desc "Yesterday" "y" #'org-roam-dailies-yesterday))
|
2020-03-29 18:48:23 -04:00
|
|
|
:config
|
2020-04-10 14:40:14 -04:00
|
|
|
(setq org-roam-directory (expand-file-name (or org-roam-directory "")
|
|
|
|
org-directory)
|
2020-04-10 23:34:57 -04:00
|
|
|
org-roam-verbose nil ; https://youtu.be/fn4jIlFwuLU
|
2020-04-23 14:46:13 -04:00
|
|
|
org-roam-completion-system
|
|
|
|
(cond ((featurep! :completion helm) 'helm)
|
|
|
|
((featurep! :completion ivy) 'ivy)
|
|
|
|
((featurep! :completion ido) 'ido)
|
|
|
|
('default))
|
|
|
|
org-roam-completion-fuzzy-match
|
|
|
|
(or (featurep! :completion helm +fuzzy)
|
|
|
|
(featurep! :completion ivy +fuzzy)))
|
2020-04-16 15:18:43 -04:00
|
|
|
|
|
|
|
;; HACK Hide the mode line in the org-roam buffer, since it serves no purpose.
|
|
|
|
;; This makes it easier to distinguish among other org buffers.
|
|
|
|
(defadvice! +org--hide-mode-line-a (&rest _)
|
|
|
|
:after #'org-roam-buffer--get-create
|
|
|
|
(with-current-buffer org-roam-buffer
|
|
|
|
(hide-mode-line-mode +1))))
|
2020-03-29 18:48:23 -04:00
|
|
|
|
|
|
|
|
|
|
|
;; 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)
|
|
|
|
|
|
|
|
|
2020-03-29 22:04:15 -04:00
|
|
|
(use-package! company-org-roam
|
2020-03-29 18:48:23 -04:00
|
|
|
:when (featurep! :completion company)
|
|
|
|
:after org-roam
|
|
|
|
:config
|
|
|
|
(set-company-backend! 'org-mode '(company-org-roam company-yasnippet company-dabbrev)))
|