Disable auto-highlight of symbol
Must now be performed on demand with `<SPC> s h`
This commit is contained in:
parent
fda445bfad
commit
8ea0b4a7db
2 changed files with 24 additions and 12 deletions
|
@ -69,7 +69,7 @@
|
|||
- [Project Searching](#project-searching)
|
||||
- [Persistent highlighting](#persistent-highlighting)
|
||||
- [Stacking highlights](#stacking-highlights)
|
||||
- [Auto-highlight symbols](#auto-highlight-symbols)
|
||||
- [Highlight current symbol](#highlight-current-symbol)
|
||||
- [Visual Star](#visual-star)
|
||||
- [Listing symbols by semantic](#listing-symbols-by-semantic)
|
||||
- [Helm-swoop](#helm-swoop)
|
||||
|
@ -1030,16 +1030,19 @@ Key Binding | Description
|
|||
<kbd>SPC h r</kbd> | restore saved highlights in the current buffer
|
||||
<kbd>SPC h s</kbd> | save current highlights
|
||||
|
||||
### Auto-highlight symbols
|
||||
### Highlight current symbol
|
||||
|
||||
`Spacemacs` supports auto highlighting of the current symbol (provided by the
|
||||
[auto-highlight-symbol][auto-highlight] mode) and add a micro-state to it
|
||||
which makes it a very handy tool to have in your tool belt.
|
||||
`Spacemacs` supports highlighting of the current symbol on demand (provided by
|
||||
the [auto-highlight-symbol][auto-highlight] mode) and add a micro-state to
|
||||
easily navigate and rename this symbol.
|
||||
|
||||
Key Binding | Description
|
||||
-----------------------|----------------------------------------------------------------
|
||||
<kbd>SPC s e</kbd> | edit all occurrences of the current symbol
|
||||
<kbd>SPC t h</kbd> | toggle the auto highlighting
|
||||
It is also possible to change the range of the navigation on the fly to:
|
||||
- buffer
|
||||
- function
|
||||
- visible area
|
||||
|
||||
To initiate the highlighting of the current symbol under point press
|
||||
<kbd>SPC s h</kbd>.
|
||||
|
||||
Navigation between the highlighted symbols can be done with the commands:
|
||||
|
||||
|
@ -1047,6 +1050,8 @@ Key Binding | Description
|
|||
-----------------------|------------------------------------------------------------
|
||||
<kbd>*</kbd> | initiate navigation micro-state
|
||||
<kbd>SPC s b</kbd> | go to the last searched occurrence of the last highlighted symbol
|
||||
<kbd>SPC s e</kbd> | edit all occurrences of the current symbol
|
||||
<kbd>SPC s h</kbd> | highlight the current symbol and all its occurrence within the current range
|
||||
<kbd>SPC s n</kbd> | go to next occurrence and initiate navigation micro-state
|
||||
<kbd>SPC s N</kbd> | go to previous occurrence and initiate navigation micro-state
|
||||
<kbd>SPC s r b</kbd> | change range to `whole buffer`
|
||||
|
|
|
@ -292,6 +292,9 @@ which require an initialization must be listed explicitly in the list.")
|
|||
(custom-set-variables
|
||||
'(ahs-case-fold-search nil)
|
||||
'(ahs-default-range (quote ahs-range-whole-buffer))
|
||||
;; disable auto-highlight of symbol
|
||||
;; current symbol should be highlight on demand with <SPC> s h
|
||||
'(ahs-idle-timer 0)
|
||||
'(ahs-idle-interval 0.25)
|
||||
'(ahs-inhibit-face-list nil))
|
||||
|
||||
|
@ -312,13 +315,17 @@ which require an initialization must be listed explicitly in the list.")
|
|||
'(evil-leader/set-key
|
||||
"se" 'ahs-edit-mode
|
||||
"sb" 'spacemacs/goto-last-searched-ahs-symbol
|
||||
"sh" (lambda () (interactive)
|
||||
(eval '(progn
|
||||
(ahs-highlight-now)
|
||||
(setq spacemacs-last-ahs-highlight-p (ahs-highlight-p))
|
||||
(spacemacs/auto-highlight-symbol-overlay-map)) nil))
|
||||
"sn" (lambda () (interactive) (eval '(progn (ahs-highlight-now) (ahs-forward)) nil))
|
||||
"sN" (lambda () (interactive) (eval '(progn (ahs-highlight-now) (ahs-backward)) nil))
|
||||
"srb" (lambda () (interactive) (eval '(ahs-change-range 'ahs-range-whole-buffer) nil))
|
||||
"srd" (lambda () (interactive) (eval '(ahs-change-range 'ahs-range-display) nil))
|
||||
"srf" (lambda () (interactive) (eval '(ahs-change-range 'ahs-range-beginning-of-defun) nil))
|
||||
"sR" (lambda () (interactive) (eval '(ahs-change-range ahs-default-range) nil))
|
||||
"th" 'auto-highlight-symbol-mode))
|
||||
"sR" (lambda () (interactive) (eval '(ahs-change-range ahs-default-range) nil))))
|
||||
(spacemacs//hide-lighter auto-highlight-symbol-mode)
|
||||
;; micro-state to easily jump from a highlighted symbol to the others
|
||||
(dolist (sym '(ahs-forward
|
||||
|
@ -367,7 +374,7 @@ which require an initialization must be listed explicitly in the list.")
|
|||
(propx/y (propertize x/y 'face ahs-plugin-whole-buffer-face))
|
||||
(hidden (if (< 0 (- overlay-count (nth 4 st))) "*" ""))
|
||||
(prophidden (propertize hidden 'face '(:weight bold))))
|
||||
(echo "%s %s%s press (n) or (N) to navigate, (R) for reset, (r) to change range"
|
||||
(echo "%s %s%s press (n/N) to navigate, (e) to edit, (r) to change range or (R) for reset"
|
||||
propplugin propx/y prophidden)))))))
|
||||
|
||||
(defun spacemacs/init-bookmark ()
|
||||
|
|
Reference in a new issue