feat(default): add .emacs.d search on <leader> s e

This commit is contained in:
Itai Y. Efrat 2021-09-21 14:24:59 +03:00 committed by Henrik Lissner
parent 7933e54542
commit 74aae48944
3 changed files with 13 additions and 0 deletions

View file

@ -123,6 +123,7 @@
((featurep! :completion helm) #'swiper-all))
:desc "Search current directory" "d" #'+default/search-cwd
:desc "Search other directory" "D" #'+default/search-other-cwd
:desc "Search .emacs.d" "e" #'+default/search-emacsd
:desc "Locate file" "f" #'+lookup/file
:desc "Jump to symbol" "i" #'imenu
:desc "Jump to visible link" "l" #'link-hint-open-link

View file

@ -711,6 +711,7 @@
((featurep! :completion helm) #'swiper-all))
:desc "Search current directory" "d" #'+default/search-cwd
:desc "Search other directory" "D" #'+default/search-other-cwd
:desc "Search .emacs.d" "e" #'+default/search-emacsd
:desc "Locate file" "f" #'locate
:desc "Jump to symbol" "i" #'imenu
:desc "Jump to visible link" "l" #'link-hint-open-link

View file

@ -21,6 +21,17 @@ If prefix ARG is set, prompt for a directory to search from."
(interactive)
(+default/search-cwd 'other))
;;;###autoload
(defun +default/search-emacsd ()
"Conduct a text search in files under `user-emacs-directory'."
(interactive)
(let ((default-directory user-emacs-directory))
(call-interactively
(cond ((featurep! :completion ivy) #'+ivy/project-search-from-cwd)
((featurep! :completion helm) #'+helm/project-search-from-cwd)
((featurep! :completion vertico) #'+vertico/project-search-from-cwd)
(#'rgrep)))))
;;;###autoload
(defun +default/search-buffer ()
"Conduct a text search on the current buffer.