(Emacs/config)~abstract +org/search-* into one handler

This commit is contained in:
2024-07-27 04:35:13 +01:00
parent bf18f7d623
commit 1b354c1dc4

View File

@@ -2791,11 +2791,15 @@ them. This allows me to search my configuration pretty quickly.
(use-package counsel (use-package counsel
:defer t :defer t
:commands (+org/swiper-goto :commands (+org/swiper-goto
+org/search-headings +org/search-headings-dir)
+org/search-config-headings)
:general :general
(file-leader (file-leader
"P" #'+org/search-config-headings) "P" (proc (interactive)
(+org/search-headings-dir (file-name-directory user-emacs-directory)
"--max-depth=1"))
"T" (proc (interactive)
(+org/search-headings-dir (file-name-directory org-directory)
"--max-depth=2")))
(search-leader (search-leader
:keymaps 'org-mode-map :keymaps 'org-mode-map
"I" #'+org/search-headings) "I" #'+org/search-headings)
@@ -2809,15 +2813,9 @@ them. This allows me to search my configuration pretty quickly.
(interactive) (interactive)
(counsel-grep-or-swiper +org/heading-regexp)) (counsel-grep-or-swiper +org/heading-regexp))
(defun +org/search-headings () (defun +org/search-headings-dir (directory &optional rg-args)
"Searches directory (of buffer) for org headings via counsel-rg" "Searches DIRECTORY for org headings via counsel-rg."
(interactive) (counsel-rg +org/heading-regexp directory rg-args)))
(counsel-rg +org/heading-regexp (file-name-directory (buffer-file-name))))
(defun +org/search-config-headings ()
"Searches config.org for org headings via +org/swiper-goto"
(interactive)
(counsel-rg +org/heading-regexp (file-name-directory user-emacs-directory) "--max-depth=1")))
#+end_src #+end_src
** Org Agenda ** Org Agenda
Org agenda provides a nice viewing for schedules. With org mode it's Org agenda provides a nice viewing for schedules. With org mode it's