In which we give Lokaltog/vim-easymotion a streak of malevolence.
Obligatory screencast
evil-easymotion
has recently replaced its ace-jump-mode
backend with avy
. Avy has several advantages, including:
- Multiple character target display
- More customization options
- A cleaner codebase
- More sophisticated algorithms (coming!)
(1) is of course, the most important because it paves the way for implementing the features of EasyMotion 2.0. I hope the transition hasn't been too rough. If you encounter any problems, please tell.
Currently most motions are supported, and it's easy to define your own easymotions.
(evilem-define (kbd "SPC w") 'evil-forward-word-begin)
To define easymotions for all motions that evil defines by default, add
(evilem-default-keybindings "SPC")
This binds all motions under the prefix SPC
in evil-motion-state-map
. This is not done by default for motions defined manually. You will need to supply the prefix.
If you use evil-leader
, then you can bind motions like this:
(evil-leader/set-key
"j" (evilem-create 'next-line))
(Note that the actual binding is more complex, as it handles things like the Emacs goal-column
and such. See the code for details)
If you want to access the motions in other evil states, you can easily use a redirection keybind
(define-key evil-insert-state-map (kbd "M-SPC") (lookup-key evil-motion-state-map (kbd "SPC")))
I invite you to open issues about whatever you find lacking in evil-easymotion
! I will try to get to you in a timely fasion (probably only good until 2016).
Pull requests are welcome as well!
I'm deeply indebted to:
- abo-abo for authoring
avy
, on which this package depends. - Lokaltog for authoring
vim-easymotion
and creating the paradigm which this package emulates.