abo-abo / avy

Jump to things in Emacs tree-style
1.74k stars 111 forks source link

Add new avy-style to use words as sequences #210

Closed fabacino closed 7 years ago

fabacino commented 7 years ago

This PR adds a new avy-style named words which uses actual words instead of arbitrary key sequences.

The words can be customized through avy-words. They do not have to be in English but should obey the rule stated in the description i.e. each word must contain at least one "vowel" used in the English language. This makes it easy to add random key sequences in case the number of words provided does not suffice for all the jump targets. It is possible to make these vowels customizable as well but I figured it would probably be overkill.

Fixes #176

abo-abo commented 7 years ago

Great job! Thanks.

alphapapa commented 7 years ago

Wow, this is really cool!

The only thing that could make it better is if you could easily filter the list of words to, e.g. letters on the home row. Although, since QWERTY only has one vowel on the home row, maybe that wouldn't be terribly practical. :)

fabacino commented 7 years ago

The words are used in the exact order specified in avy-words. Currently they are listed in alphabetical order which is probably not the best way as similar looking words are often next to each other (e.g. gum, gun, gut) and words which are easy to type are not preferred over hard ones. Feel free too arrange them in an order which optimises one or both of these points.

viniciussbs commented 7 years ago

@fabacino It's possible to use style 'words only for specific functions?

fabacino commented 7 years ago

@viniciussbs Should be possible by using avy-styles-alist.