From e7a94003ac96c6096cd938979060a86ad81edbad Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Tue, 21 Jan 2025 09:33:05 +0000 Subject: [PATCH] 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. --- site-modules/core/files/emacs/init.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/site-modules/core/files/emacs/init.el b/site-modules/core/files/emacs/init.el index 18ec609..3872a80 100644 --- a/site-modules/core/files/emacs/init.el +++ b/site-modules/core/files/emacs/init.el @@ -165,6 +165,11 @@ just in in the current buffer." org-export-with-toc nil org-html-head "") +(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 '(("d" "Dashboard" ((agenda "" ((org-deadline-warning-days 7))) @@ -470,7 +475,7 @@ Works in both `notmuch-show-mode` and `notmuch-search-mode`." (aa/leader-keys ;; 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") "SPC" '(counsel-M-x :which-key "M-x")