Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prioritise (promote) the last-typed character in keys for the sneak-style motions #357

Open
ELLIOTTCABLE opened this issue Nov 24, 2017 · 0 comments

Comments

@ELLIOTTCABLE
Copy link

@justinmk copied a feature from clever-f.vim to vim-sneak, that allows one to repeat the mapping (hit s again after an s, for instance) to reach further instances of the pair.

This doesn't map directly to EasyMotion, in which further instances are reached by direct entry of a character from g:EasyMotion_keys; but I believe similar usability can be achieved with one simple modification:

Prepend the last character of an N-character sneak to g:EasyMotion_keys.

So, if I type sle, and there are several instances of le — the nearest key I could possibly hit, is the one my finger is already over: e! Thus, I propose we promote e, if it exists in g:EasyMotion_keys at all, to the front of g:EasyMotion_keys, so that the very first-nearest result is always instantly accessible by repeating the last character of your search: slee.


This is especially useful when replacing fFtT with EasyMotion movements, as I have:

nmap f <Plug>(easymotion-fl) | xmap f <Plug>(easymotion-fl) | omap f <Plug>(easymotion-fl)
nmap F <Plug>(easymotion-Fl) | xmap F <Plug>(easymotion-Fl) | omap F <Plug>(easymotion-Fl)
nmap t <Plug>(easymotion-tl) | xmap t <Plug>(easymotion-tl) | omap t <Plug>(easymotion-tl)
nmap T <Plug>(easymotion-Tl) | xmap T <Plug>(easymotion-Tl) | omap T <Plug>(easymotion-Tl)

With the above suggestion, in the extremely-common case that “I just want to jump to the next [, then when typing f[, if there's more than one result, your finger is already hovering over the key that will get you where you wanted to go: f[[.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant