More convenient search buffer

This commit is contained in:
Nham Le 2020-07-31 12:55:29 +07:00
parent 0c47a03491
commit 6a4283c9d4
3 changed files with 9 additions and 4 deletions

View file

@ -118,8 +118,7 @@
:desc "Look up in all docsets" "K" #'+lookup/in-all-docsets
:desc "Search project" "p" #'+default/search-project
:desc "Search other project" "P" #'+default/search-other-project
:desc "Search buffer" "s" #'swiper-isearch
:desc "Search buffer for thing at point" "S" #'swiper-isearch-thing-at-point
:desc "Search buffer" "s" #'+default/search-buffer
:desc "Dictionary" "t" #'+lookup/dictionary-definition
:desc "Thesaurus" "T" #'+lookup/synonyms)

View file

@ -648,8 +648,7 @@
:desc "Search project" "p" #'+default/search-project
:desc "Search other project" "P" #'+default/search-other-project
:desc "Jump to mark" "r" #'evil-show-marks
:desc "Search buffer" "s" #'swiper-isearch
:desc "Search buffer for thing at point" "S" #'swiper-isearch-thing-at-point
:desc "Search buffer" "s" #'+default/search-buffer
:desc "Dictionary" "t" #'+lookup/dictionary-definition
:desc "Thesaurus" "T" #'+lookup/synonyms)

View file

@ -21,6 +21,13 @@ If prefix ARG is set, prompt for a directory to search from."
(+default/search-cwd 'other))
;;;###autoload
(defun +default/search-buffer (&optional arg)
(interactive "P")
(if (region-active-p)
(call-interactively #'swiper-isearch-thing-at-point)
(call-interactively #'swiper-isearch)))
;;;autoload
(defun +default/search-project (&optional arg)
"Conduct a text search in the current project root.
If prefix ARG is set, prompt for a known project to search from."