aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-07-27 04:35:13 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-07-27 04:35:13 +0100
commit1b354c1dc46faf61827073945c51f5225ad3f99f (patch)
tree82976f2c659cec2726af63fb34bae81337afbd85 /Emacs/.config/emacs
parentbf18f7d623f50aab94b22b2d3071c5ee4d9fdf43 (diff)
downloaddotfiles-1b354c1dc46faf61827073945c51f5225ad3f99f.tar.gz
dotfiles-1b354c1dc46faf61827073945c51f5225ad3f99f.tar.bz2
dotfiles-1b354c1dc46faf61827073945c51f5225ad3f99f.zip
(Emacs/config)~abstract +org/search-* into one handler
Diffstat (limited to 'Emacs/.config/emacs')
-rw-r--r--Emacs/.config/emacs/config.org22
1 files changed, 10 insertions, 12 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org
index 72be518..b94e124 100644
--- a/Emacs/.config/emacs/config.org
+++ b/Emacs/.config/emacs/config.org
@@ -2791,11 +2791,15 @@ them. This allows me to search my configuration pretty quickly.
(use-package counsel
:defer t
:commands (+org/swiper-goto
- +org/search-headings
- +org/search-config-headings)
+ +org/search-headings-dir)
:general
(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
:keymaps 'org-mode-map
"I" #'+org/search-headings)
@@ -2809,15 +2813,9 @@ them. This allows me to search my configuration pretty quickly.
(interactive)
(counsel-grep-or-swiper +org/heading-regexp))
- (defun +org/search-headings ()
- "Searches directory (of buffer) for org headings via counsel-rg"
- (interactive)
- (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")))
+ (defun +org/search-headings-dir (directory &optional rg-args)
+ "Searches DIRECTORY for org headings via counsel-rg."
+ (counsel-rg +org/heading-regexp directory rg-args)))
#+end_src
** Org Agenda
Org agenda provides a nice viewing for schedules. With org mode it's