From 29605f57ebc302a4f6ac6ecec9fe81101e390dc3 Mon Sep 17 00:00:00 2001 From: Adrian Staniec Date: Wed, 2 Nov 2016 01:00:18 +0100 Subject: [PATCH] add perm. highlight and swoop/swiper to Symbol Highlight Transient State --- layers/+completion/helm/packages.el | 5 +++-- layers/+completion/ivy/packages.el | 5 +++-- layers/+spacemacs/spacemacs-navigation/funcs.el | 6 ++++++ layers/+spacemacs/spacemacs-navigation/packages.el | 3 ++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/layers/+completion/helm/packages.el b/layers/+completion/helm/packages.el index c84fb2647..4f30e5a48 100644 --- a/layers/+completion/helm/packages.el +++ b/layers/+completion/helm/packages.el @@ -46,11 +46,12 @@ ;; add some functions to ahs transient states (setq spacemacs--symbol-highlight-transient-state-doc (concat spacemacs--symbol-highlight-transient-state-doc - " [_b_] search buffers [_/_] search proj [_f_] search files") + " [_b_] search buffers [_/_] search proj [_f_] search files [_s_] swoop") spacemacs-symbol-highlight-transient-state-add-bindings '(("/" spacemacs/helm-project-smart-do-search-region-or-symbol :exit t) ("b" spacemacs/helm-buffers-smart-do-search-region-or-symbol :exit t) - ("f" spacemacs/helm-files-smart-do-search-region-or-symbol :exit t))))) + ("f" spacemacs/helm-files-smart-do-search-region-or-symbol :exit t) + ("s" spacemacs/helm-swoop-region-or-symbol :exit t))))) (defun helm/post-init-bookmark () (spacemacs/set-leader-keys "fb" 'helm-filtered-bookmarks)) diff --git a/layers/+completion/ivy/packages.el b/layers/+completion/ivy/packages.el index 0b5d152f7..19dfd7a61 100644 --- a/layers/+completion/ivy/packages.el +++ b/layers/+completion/ivy/packages.el @@ -35,11 +35,12 @@ ;; add some functions to ahs transient states (setq spacemacs--symbol-highlight-transient-state-doc (concat spacemacs--symbol-highlight-transient-state-doc - " [_b_] search buffers [_/_] search proj [_f_] search files") + " [_b_] search buffers [_/_] search proj [_f_] search files [_s_] swiper") spacemacs-symbol-highlight-transient-state-add-bindings '(("/" spacemacs/search-project-auto-region-or-symbol :exit t) ("b" spacemacs/swiper-all-region-or-symbol :exit t) - ("f" spacemacs/search-auto-region-or-symbol :exit t))))) + ("f" spacemacs/search-auto-region-or-symbol :exit t) + ("s" spacemacs/swiper-region-or-symbol :exit t))))) (defun ivy/init-counsel () (use-package counsel diff --git a/layers/+spacemacs/spacemacs-navigation/funcs.el b/layers/+spacemacs/spacemacs-navigation/funcs.el index 06e5dc974..629dcd822 100644 --- a/layers/+spacemacs/spacemacs-navigation/funcs.el +++ b/layers/+spacemacs/spacemacs-navigation/funcs.el @@ -170,6 +170,12 @@ (spacemacs//symbol-highlight-doc) (make-string (length (spacemacs//symbol-highlight-doc)) 32)))) +(defun spacemacs/symbol-highlight-permanent () + "Highlight the symbol under point with `highlight-symbol-at-point'." + (interactive) + (highlight-symbol-at-point) + (spacemacs/ahs-highlight-now-wrapper)) + ;; golden ratio diff --git a/layers/+spacemacs/spacemacs-navigation/packages.el b/layers/+spacemacs/spacemacs-navigation/packages.el index 6cf4ff2c8..157d7f200 100644 --- a/layers/+spacemacs/spacemacs-navigation/packages.el +++ b/layers/+spacemacs/spacemacs-navigation/packages.el @@ -74,7 +74,7 @@ ahs-inhibit-face-list nil spacemacs--symbol-highlight-transient-state-doc " - %s [_n_] next [_N_/_p_] previous [_r_] change range [_R_] reset [_e_] iedit + %s [_n_] next [_N_/_p_] previous [_r_] change range [_R_] reset [_e_] iedit [_h_] highlight %s [_d_/_D_] next/previous definition") ;; since we are creating our own maps, @@ -136,6 +136,7 @@ ("d" ahs-forward-definition) ("D" ahs-backward-definition) ("e" spacemacs/ahs-to-iedit :exit t) + ("h" spacemacs/symbol-highlight-permanent) ("n" spacemacs/quick-ahs-forward) ("N" spacemacs/quick-ahs-backward) ("p" spacemacs/quick-ahs-backward)