hop.nvim
hop.nvim copied to clipboard
Make `HopWord` behave like in EasyMotion
Hop distributes annotations in a cloud around cursor and last words in the same and the next strings are get 2-keys annotation.
Easymotion distributes 1-key annotations straightforward along lines while they are not end, then it distributes 2-key and so on.
The Easymotion behavior suits me better, because when I want to jump somewhere far I use HopChar1 and use word jumps when I want to jump somewhere nearby, usualy from the beginning of the line somewhere to the end of the same or the second line and annotations there always 2-keys despite rather small distance in "words" metrics. And words under the cursor have 1-key annotations, which I don't need, because if I want there I just press j 2 times instead of invoke hop plugin.
hop


easymotion


Is it possible to make HopWord command behave like in EasyMotion?
Oh yes, that’s very easy to change. The way to change it is to make the distribution function customizable. Basically, have a way to customize the sort function. I will have a look into that. There are two ways:
- Implement some default sorting strategies. There are currently two: the one you mentioned, and reversing that (far keys get 1-chord, near keys get lots). We can imagine naming those and adding yours as a third alternative.
- Expose the sorting function directly in the
optsand let people provide it (if not provided, it will use the default).
I prefer 1. because configuration shouldn’t have any logic of code, but well, I guess we can explore, too.
The first variant is better, because not a lot of people would write their own sorting function.
Hi! Any updates here?