selectrum: improve bindings

- add missing emacs bindings
- properly feature guard swiper related bindings
- for selectrum, unbind `SPC s B` and temporarily bind `SPC s s` to
  isearch to prevent don't get errors until we decide what to do there.
- update readme to reflect that
This commit is contained in:
Itai Y. Efrat 2021-05-17 15:44:39 +03:00
parent c349a0a046
commit ed922a62cb
5 changed files with 33 additions and 18 deletions

View file

@ -113,8 +113,13 @@
;;; <leader> 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)))
;;; <leader> T --- twitter
(:when (featurep! :app twitter)

View file

@ -678,9 +678,12 @@
;;; <leader> 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)

View file

@ -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)