feat(emacs): add / key binding to search the roam notes

Usually this mapping would be to live grep in the current project. With emacs I
only have one project and thats my notes. The sole purpose of emacs for me is
to organize my self with org

Now this binding search for content in the org notes directory treating that as
the project.
This commit is contained in:
Ade Attwood 2025-01-21 09:33:05 +00:00
parent 770ca92c2b
commit e7a94003ac

View file

@ -165,6 +165,11 @@ just in in the current buffer."
org-export-with-toc nil org-export-with-toc nil
org-html-head "<style>body { font-family: system-ui; }</style>") org-html-head "<style>body { font-family: system-ui; }</style>")
(defun aa/search-org-roam-notes ()
"Search in the Org-Roam folder using counsel-rg."
(interactive)
(counsel-rg nil org-roam-directory nil "Search Org Roam: "))
(setq org-agenda-custom-commands (setq org-agenda-custom-commands
'(("d" "Dashboard" '(("d" "Dashboard"
((agenda "" ((org-deadline-warning-days 7))) ((agenda "" ((org-deadline-warning-days 7)))
@ -470,7 +475,7 @@ Works in both `notmuch-show-mode` and `notmuch-search-mode`."
(aa/leader-keys (aa/leader-keys
;; Global bindings ;; Global bindings
"/" '(counsel-projectile-ag :which-key "Search Project") "/" '(aa/search-org-roam-notes :which-key "Search Org Roam")
"TAB" '(evil-switch-to-windows-last-buffer :which-key "Last Buffer") "TAB" '(evil-switch-to-windows-last-buffer :which-key "Last Buffer")
"SPC" '(counsel-M-x :which-key "M-x") "SPC" '(counsel-M-x :which-key "M-x")