I'm using vertigo with evil in the following way:
(evil-define-motion vertigo-j (count)
"Evil vertigo motion. Count has no effect."
(vertigo--jump #'evil-next-line "Jump down: "))
...and I map it to j
with:
(define-key evil-normal-state-map (kbd "j") #'vertigo-j)
(define-key evil-visual-state-map (kbd "j") #'vertigo-j)
(define-key evil-motion-state-map (kbd "j") #'vertigo-j)
It works well enough for normal motion, but when I try to delete some lines (with dj
), something strange happens. I go from:
1 It was on ▊a dreary
2 night of November that I
3 beheld the accomplishment
4 of my toils. With an
5 anxiety that almost
6 amounted to agony, I
7 collected the instruments...
(where ▊
is point), and, by pressing dj
and f
(delete down 4 lines), I get:
1 It was on ▊at almost
2 amounted to agony, I
3 collected the instruments...
What should have happened is that the whole of the first line was deleted, along with the whole of line 5:
1 ▊amounted to agony, I
2 collected the instruments...
What is incorrect about my remapping, and how can I fix it to get the desired behaviour?
evil-define-motion
), Evil's info manual (section 5.1) shows that you can also set its type, e.g.type: line
so that "the range is expanded to linewise positions" - if that's what you want (see also the 'block' type). I didn't test this, but I think that's what you're after. And if we're here, perhaps you also want to set:jump t
.