This package emulates quick_scope.vim by Brian Le. It highlights targets for evil-mode’s f,F,t,T keys, allowing for quick navigation within a line with no additional mappings.
This program requires EVIL (http://bitbucket.org/lyro/evil/wiki/Home)
Place evil-quickscope.el in the load-path
and add the following to ~/.emacs:
(require 'evil-quickscope)
The functionality is wrapped into two different minor modes. Only one can be activated at a time.
evil-quickscope-always-mode provides targets at all times and directly emulates quick_scope.vim. It can be activated by adding the following to ~/.emacs:
(global-evil-quickscope-always-mode 1)
Alternatively, you can enable evil-quickscope-always-mode in certain modes by adding ‘turn-on-evil-quickscope-always-mode’ to the mode hook. For example:
(add-hook 'prog-mode-hook 'turn-on-evil-quickscope-always-mode)
evil-quickscope-mode provides targets only after one of the f,F,t,T keys are pressed. It can be activated by adding the following to ~/.emacs:
(global-evil-quickscope-mode 1)
Or, you can use ‘turn-on-evil-quickscope-mode’ as a mode hook:
(add-hook 'prog-mode-hook 'turn-on-evil-quickscope-mode)
The faces evil-quickscope uses to highlight targets are defined in
evil-quickscope-first-face
and evil-quickscope-second-face
.
By default, evil-quickscope-mode only shows targets in the direction of the
f,F,t,T command. This behavior can be changed to show targets in both directions
by using setq
or M-x customize evil-quickscope
to set
evil-quickscope-bidirectional
to t
.
The parameter evil-quickscope-cross-lines
controls whether targets on
different lines are highlighted. Should be used in conjunction with the
parameter evil-cross-lines
.
The parameter evil-quickscope-disable-in-comments
disables
evil-quickscope-always-mode overlays when the point is inside a comment. Useful
when overlays are cluttering the buffer when trying to read comments. Defaults
to nil.