From dfce5ddb17de1cc979129d0b9b11de2ae1bce340 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Fri, 19 Feb 2021 20:48:34 -0600 Subject: [PATCH] feat(selectrum): Add +selectrum/search-symbol-at-point --- modules/completion/selectrum/autoload/selectrum.el | 5 +++++ modules/config/default/+evil-bindings.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/completion/selectrum/autoload/selectrum.el b/modules/completion/selectrum/autoload/selectrum.el index 051319ace..3212f75ff 100644 --- a/modules/completion/selectrum/autoload/selectrum.el +++ b/modules/completion/selectrum/autoload/selectrum.el @@ -67,3 +67,8 @@ in the search." If ARG (universal argument), include all files, even hidden or compressed ones." (interactive "P") (+selectrum/project-search arg initial-query default-directory)) + +;;;###autoload +(defun +selectrum/search-symbol-at-point () + (interactive) + (consult-line (thing-at-point 'symbol))) diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index bc73462fb..a6b33c761 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -702,7 +702,9 @@ :desc "Search other project" "P" #'+default/search-other-project :desc "Jump to mark" "r" #'evil-show-marks :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 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)