hlissner / evil-snipe

2-char searching ala vim-sneak & vim-seek, for evil-mode
MIT License
336 stars 25 forks source link

Highlight targets for f, F, t and T keys #81

Open adolfocorreia opened 3 years ago

adolfocorreia commented 3 years ago

Feature request: Highlight targets after pressing f, F, t and T keys à la quick-scope (https://github.com/unblevable/quick-scope).

I know this feature is somewhat redundant with the s/S keys, but I think it is useful anyway in order to quickly identify unique characters in every word on a line and jump to them without hitting ;. The benefits in relation to using s/S would be to use one less key press and, more importantly, having no "surprises" in the case of an unexpected match (which might occur even with s/S) on a previous word.

I tried using evil-quickscope (https://github.com/blorbx/evil-quickscope), but it seems to be unmaintained and it conflicted with evil-snipe (I use Doom Emacs) since both packages need to bind the same keys.

hlissner commented 3 years ago

I'm not sure I understand the request, or how it differs from evil-snipe-override-mode, which provides incremental highlighting for f/F/t/T like I do with s/S. Actually, maybe I do understand the request, which seems a bit out of scope for this plugin; evil-quickscope seems like the better option here.

In any case, I think this is outside the scope of this plugin (whose goal is to port vim-seek/vim-sneak functionality). If you'd rather use evil-quickscope instead of evil-snipe, then Doom gives you a simple way to disable whole packages.

Hope that helps.

adolfocorreia commented 3 years ago

Thanks for your prompt response!

Let me try to clarify what I meant. When using evil-snipe-override-mode, the incremental highlighting for f/F/t/T only kicks in when you type both the command key (e.g. f) and the character you are looking for (e.g. x). The behaviour I was trying to describe is to have the highlighting kicking in right after the command key (f), identifying the unique characters in each word. When the second key (x) is eventually pressed, the regular evil-snipe highlighting behaviour should be resumed.

I tried using both plugins together imagining I could get the behaviour I described, but there were some non-trivial conflicts. Now I'm thinking about implementing it by myself. Would you consider incorporating this behaviour into evil-snipe (maybe as an optional setting), or do you still think it is out of scope?

Anyway, thanks for the great work you've been doing with Doom. And I hope you get better soon!

adolfocorreia commented 3 years ago

As a further comment on this issue, although I initially only considered this new highlighting behavior for f/F/t/T (because of my current workflow with quick-scope in vim), it might be useful even for s/S. Similarly, after just pressing s/S, it would be nice to have unique two-characters combinations highlighted on every word.

hlissner commented 3 years ago

Ah, I see what you're getting at. Yeah, I think I could add that to this package. I currently have a rewrite of it in the works, I'll look into incorporating this into that.

adolfocorreia commented 3 years ago

Great!