From 9fff0eef97c824d3058d719700304a8ae398ba15 Mon Sep 17 00:00:00 2001 From: Emmet Date: Tue, 26 Sep 2023 17:04:33 -0500 Subject: [PATCH] org roam improvements (added inbox feature) --- user/app/doom-emacs/config.el | 30 ++++++++++++++++++++++++++++++ user/app/doom-emacs/doom.org | 30 ++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/user/app/doom-emacs/config.el b/user/app/doom-emacs/config.el index a6660f8..223853a 100644 --- a/user/app/doom-emacs/config.el +++ b/user/app/doom-emacs/config.el @@ -517,6 +517,16 @@ same directory as the org-buffer and insert a link to this file." (org-roam-db-autosync-mode) +(setq mode-line-misc-info '((which-function-mode + (which-func-mode + ("" which-func-format " "))) + ("" so-long-mode-line-info) + (global-mode-string + ("" global-mode-string)) + " " + org-roam-db-choice) +) + (setq full-org-roam-db-list nil) (setq full-org-roam-db-list (directory-files "~/Org" t "\\.[p,s]$")) @@ -539,6 +549,20 @@ same directory as the org-buffer and insert a link to this file." (dired org-roam-directory)) ) +(defun org-roam-open-inbox () + "Capture info in ${org-roam-directory}/inbox.org (I use this naming convention to create dashboards for each of my org roam maps)" + (interactive) + (if (file-exists-p (concat org-roam-directory "/inbox.org")) + (org-open-file (concat org-roam-directory "/inbox.org")) + (message "No inbox found, capture something with M-x org-roam-capture-inbox")) +) + +(defun org-roam-capture-inbox () + (interactive) + (org-roam-capture- :node (org-roam-node-create) + :templates '(("i" "inbox" plain "* %?" + :if-new (file+head "inbox.org" "#+title: Inbox\n"))))) + (defun org-roam-switch-db (&optional arg silent) "Switch to a different org-roam database, arg" (interactive) @@ -721,6 +745,12 @@ tasks." :desc "Capture new roam node" "c" 'org-roam-capture + :desc "Open org roam inbox" + "I o" 'org-roam-open-inbox + + :desc "Capture stuff in inbox" + "I c" 'org-roam-capture-inbox + :desc "Insert roam node link at point" "i" 'org-roam-node-insert diff --git a/user/app/doom-emacs/doom.org b/user/app/doom-emacs/doom.org index 5900ce5..3f7cfc1 100644 --- a/user/app/doom-emacs/doom.org +++ b/user/app/doom-emacs/doom.org @@ -636,6 +636,16 @@ exit (org-roam-db-autosync-mode) +(setq mode-line-misc-info '((which-function-mode + (which-func-mode + ("" which-func-format " "))) + ("" so-long-mode-line-info) + (global-mode-string + ("" global-mode-string)) + " " + org-roam-db-choice) +) + #+END_SRC *** Multi Org Roam Configuration #+BEGIN_SRC emacs-lisp :tangle config.el @@ -661,6 +671,20 @@ exit (dired org-roam-directory)) ) +(defun org-roam-open-inbox () + "Capture info in ${org-roam-directory}/inbox.org (I use this naming convention to create dashboards for each of my org roam maps)" + (interactive) + (if (file-exists-p (concat org-roam-directory "/inbox.org")) + (org-open-file (concat org-roam-directory "/inbox.org")) + (message "No inbox found, capture something with M-x org-roam-capture-inbox")) +) + +(defun org-roam-capture-inbox () + (interactive) + (org-roam-capture- :node (org-roam-node-create) + :templates '(("i" "inbox" plain "* %?" + :if-new (file+head "inbox.org" "#+title: Inbox\n"))))) + (defun org-roam-switch-db (&optional arg silent) "Switch to a different org-roam database, arg" (interactive) @@ -852,6 +876,12 @@ tasks." :desc "Capture new roam node" "c" 'org-roam-capture + :desc "Open org roam inbox" + "I o" 'org-roam-open-inbox + + :desc "Capture stuff in inbox" + "I c" 'org-roam-capture-inbox + :desc "Insert roam node link at point" "i" 'org-roam-node-insert