abo-abo / avy

Jump to things in Emacs tree-style
1.71k stars 109 forks source link

Jump to word by whitespacem, equivalent to easymotion's <leader>W? #278

Closed rsheasby closed 5 years ago

rsheasby commented 5 years ago

In easymotion, the key chords closely match those of the general Vim interface's keymap. For example, where W goes forward one word, where whitespace is the only separator between words, \W will open easymotion on all words by whitespace separator only, greatly reducing the amount of candidates in many cases. Avy is great for moving from Vim to Emacs, as easymotion was one of my absolutely necessary plugins. However, it seems this option is missing from avy. Is there a way to configure a function with similar behavior?

abo-abo commented 5 years ago

I'm not a Vim user, so I don't fully understand. Can you post a screenshot, or maybe a small tutorial on how to set up easymotion on Vim?

rsheasby commented 5 years ago

Simply put, Vim considers a word (the w command) to be a series of mostly alphanumeric characters delimited by certain special characters or whitespace. When using easymotion's \w command, the following will be displayed, allowing the user to jump to a word by the aforementioned definition: word

On the other hand, Vim also has the concept of a WORD (the W command) which is a sequence of any non-whitespace characters, delimited by whitespace. Doing \W in easymotion will present the user with the following: WORD Notice that it considers the URL as a single WORD, as WORDs are delimited by whitespace only. That's the feature I'm requesting.

abo-abo commented 5 years ago

Thanks, please test.

rsheasby commented 5 years ago

That seems to work perfectly, although it doesn't have the full range of motions. Specifically, avy-goto-whitespace-end-above and avy-goto-whitespace-end-below. It only has a global jump.

abo-abo commented 5 years ago

Thanks, I've added those two commands as well.

rsheasby commented 5 years ago

Now that's service! Thanks, will test as soon as it makes its way to Melpa.