diff --git a/modules/completion/selectrum/README.org b/modules/completion/selectrum/README.org index 28e4ad567..34b809f04 100644 --- a/modules/completion/selectrum/README.org +++ b/modules/completion/selectrum/README.org @@ -105,17 +105,15 @@ users). https://assets.doomemacs.org/completion/selectrum/search-replace.png ** TODO In-buffer searching -The =swiper= package provides an interactive buffer search powered by ivy. It -can be invoked with: +This module provides some in buffer searching bindings: -+ =SPC s s= (~swiper-isearch~) -+ =SPC s S= (~swiper-isearch-thing-at-point~) ++ =SPC s s= (~isearch~) ++ =SPC s S= (~+selectrum/search-symbol-at-point~ via ~consult-line~) + =SPC s b= (~consult-line~) -+ ~:sw[iper] [QUERY]~ https://assets.doomemacs.org/completion/selectrum/buffer-search.png -A wgrep buffer can be opened from swiper with =C-c C-e=. +A wgrep buffer can be opened from ~consult-line~ with =C-c C-e= (not yet). ** Selectrum integration for various completing commands *** General diff --git a/modules/completion/selectrum/TODO.org b/modules/completion/selectrum/TODO.org index a442bb3ad..966b4bc8b 100644 --- a/modules/completion/selectrum/TODO.org +++ b/modules/completion/selectrum/TODO.org @@ -5,9 +5,10 @@ ** TODO consider dropping prescient flag ** TODO =SPC s s= and =SPC s S= ~:sw~ ? There isn't really a selectrum analogue to ~swiper-isearch~, ~consult-isearch~ -does something else (give you previously used isearch search terms). +does something else (give you previously used isearch search terms). Bound to +regular isearch for now. ** TODO =SPC s B= -Selectrum/Consult don't have a ~swiper-all~ analogue either. +Selectrum/Consult don't have a ~swiper-all~ analogue either. Unbound for now. * PROJ Bugs ** TODO =C-SPC= and live previews diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index b8eb376b3..b3a7e72d2 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -113,8 +113,13 @@ ;;; s --- search (:prefix-map ("s" . "search") :desc "Search project for symbol" "." #'+default/search-project-for-symbol-at-point - :desc "Search buffer" "b" #'swiper - :desc "Search all open buffers" "B" #'swiper-all + :desc "Search buffer" "b" + (cond ((featurep! :completion helm) #'swiper) + ((featurep! :completion ivy) #'swiper) + ((featurep! :completion selectrum) #'consult-line)) + :desc "Search all open buffers" "B" + (cond ((featurep! :completion helm) #'swiper-all) + ((featurep! :completion ivy) #'swiper-all)) :desc "Search current directory" "d" #'+default/search-cwd :desc "Search other directory" "D" #'+default/search-other-cwd :desc "Locate file" "f" #'+lookup/file @@ -129,7 +134,10 @@ :desc "Search project" "p" #'+default/search-project :desc "Search other project" "P" #'+default/search-other-project :desc "Search buffer" "s" #'+default/search-buffer - :desc "Search buffer for thing at point" "S" #'swiper-isearch-thing-at-point + :desc "Search buffer for thing at point" "S" + (cond ((featurep! :completion helm) #'swiper-isearch-thing-at-point) + ((featurep! :completion ivy) #'swiper-isearch-thing-at-point) + ((featurep! :completion selectrum) #'+selectrum/search-symbol-at-point)) :desc "Dictionary" "t" #'+lookup/dictionary-definition :desc "Thesaurus" "T" #'+lookup/synonyms) @@ -425,7 +433,9 @@ :desc "Reconnect all" "r" #'circe-reconnect-all :desc "Send message" "s" #'+irc/send-message (:when (featurep! :completion ivy) - :desc "Jump to channel" "j" #'+irc/ivy-jump-to-channel))) + :desc "Jump to channel" "j" #'+irc/ivy-jump-to-channel) + (:when (featurep! :completion selectrum) + :desc "Jump to channel" "j" #'+irc/selectrum-jump-to-channel))) ;;; T --- twitter (:when (featurep! :app twitter) diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index 4aeb33fcc..78e5145b7 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -678,9 +678,12 @@ ;;; s --- search (:prefix-map ("s" . "search") :desc "Search buffer" "b" - (cond ((featurep! :completion ivy) #'swiper) + (cond ((featurep! :completion helm) #'swiper) + ((featurep! :completion ivy) #'swiper) ((featurep! :completion selectrum) #'consult-line)) - :desc "Search all open buffers" "B" #'swiper-all + :desc "Search all open buffers" "B" + (cond ((featurep! :completion helm) #'swiper-all) + ((featurep! :completion ivy) #'swiper-all)) :desc "Search current directory" "d" #'+default/search-cwd :desc "Search other directory" "D" #'+default/search-other-cwd :desc "Locate file" "f" #'locate @@ -698,7 +701,8 @@ :desc "Jump to mark" "r" #'evil-show-marks :desc "Search buffer" "s" #'+default/search-buffer :desc "Search buffer for thing at point" "S" - (cond ((featurep! :completion ivy) #'swiper-isearch-thing-at-point) + (cond ((featurep! :completion helm) #'swiper-isearch-thing-at-point) + ((featurep! :completion ivy) #'swiper-isearch-thing-at-point) ((featurep! :completion selectrum) #'+selectrum/search-symbol-at-point)) :desc "Dictionary" "t" #'+lookup/dictionary-definition :desc "Thesaurus" "T" #'+lookup/synonyms) diff --git a/modules/config/default/autoload/search.el b/modules/config/default/autoload/search.el index 899099fda..c9344751f 100644 --- a/modules/config/default/autoload/search.el +++ b/modules/config/default/autoload/search.el @@ -27,9 +27,11 @@ If prefix ARG is set, prompt for a directory to search from." If a selection is active, pre-fill the prompt with it." (interactive) (call-interactively - (if (region-active-p) - #'swiper-isearch-thing-at-point - #'swiper-isearch))) + (cond ((or (featurep! :completion helm) (featurep! :completion ivy)) + (if (region-active-p) + #'swiper-isearch-thing-at-point + #'swiper-isearch)) + ((featurep! :completion selectrum) #'isearch-forward)))) ;;;###autoload (defun +default/search-project (&optional arg)