diff --git a/core/autoload/help.el b/core/autoload/help.el index b664da6bf..3d008d9cf 100644 --- a/core/autoload/help.el +++ b/core/autoload/help.el @@ -121,7 +121,8 @@ selection of all minor-modes, active or not." ;; ;;; Documentation commands -(defun doom--org-headings (files &optional depth include-files) +;;;###autoload +(defun doom-completing-read-org-headlings (files &optional depth include-files) (require 'org) (let* ((default-directory doom-docs-dir) (org-agenda-files (mapcar #'expand-file-name (doom-enlist files))) @@ -167,8 +168,9 @@ selection of all minor-modes, active or not." "Search Doom's documentation and jump to a headline." (interactive) (let (ivy-sort-functions-alist) - (completing-read "Find in Doom help: " - (doom--org-headings (list "getting_started.org" + (completing-read + "Find in Doom help: " + (doom-completing-read-org-headlings (list "getting_started.org" "contributing.org" "troubleshooting.org" "tutorials.org" @@ -180,7 +182,7 @@ selection of all minor-modes, active or not." "Search Doom's FAQ and jump to a question." (interactive) (completing-read "Find in FAQ: " - (doom--org-headings (list "faq.org")))) + (doom-completing-read-org-headlings (list "faq.org")))) ;;;###autoload (defun doom/help-news () diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index 3f8a6bff5..d5e0c6a1f 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -675,12 +675,16 @@ ;;; n --- notes (:prefix-map ("n" . "notes") - :desc "Open deft" "d" #'deft - :desc "Find file in notes" "n" #'+default/find-in-notes - :desc "Browse notes" "N" #'+default/browse-notes - :desc "Pop scratch buffer" "s" #'doom/open-scratch-buffer - :desc "Org capture" "x" #'org-capture - :desc "Org store link" "l" #'org-store-link) + :desc "Browse notes" "." #'+default/browse-notes + :desc "Search notes" "/" #'+default/org-notes-search + :desc "Search notes for symbol" "*" #'+default/search-notes-for-symbol-at-point + :desc "Open deft" "d" #'deft + :desc "Search org agenda headlines" "h" #'+default/org-notes-headlines + :desc "Find file in notes" "n" #'+default/find-in-notes + :desc "Browse notes" "N" #'+default/browse-notes + :desc "Pop scratch buffer" "s" #'doom/open-scratch-buffer + :desc "Org capture" "x" #'org-capture + :desc "Org store link" "l" #'org-store-link) ;;; o --- open (:prefix-map ("o" . "open") diff --git a/modules/config/default/autoload/default.el b/modules/config/default/autoload/default.el index ad8b5d12b..509034e64 100644 --- a/modules/config/default/autoload/default.el +++ b/modules/config/default/autoload/default.el @@ -255,8 +255,7 @@ If prefix ARG is set, prompt for a known project to search from." "Conduct a text search in the current project for symbol at point. If prefix ARG is set, prompt for a known project to search from." (interactive - (list current-prefix-arg - (thing-at-point 'symbol t))) + (list current-prefix-arg (thing-at-point 'symbol t))) (let ((default-directory (if arg (if-let* ((projects (projectile-relevant-known-projects))) @@ -269,3 +268,30 @@ If prefix ARG is set, prompt for a known project to search from." ((featurep! :completion helm) (+helm/project-search nil (rxt-quote-pcre symbol))) ((rgrep (regexp-quote symbol)))))) + +;;;###autoload +(defun +default/search-notes-for-symbol-at-point (&optional arg symbol) + "Conduct a text search in the current project for symbol at point. If prefix +ARG is set, prompt for a known project to search from." + (interactive + (list current-prefix-arg (thing-at-point 'symbol t))) + (require 'org) + (let ((default-directory org-directory)) + (+default/search-project-for-symbol-at-point + nil symbol))) + +;;;###autoload +(defun +default/org-notes-search () + "Perform a text search on `org-directory'." + (interactive) + (require 'org) + (let ((default-directory org-directory)) + (+default/search-project-for-symbol-at-point nil ""))) + +;;;###autoload +(defun +default/org-notes-headlines () + "Jump to an Org headline in `org-agenda-files'." + (interactive) + (completing-read + "Jump to org headline: " + (doom-completing-read-org-headlings org-agenda-files 3 t)))