philc / vimium

The hacker's browser.
https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb
MIT License
23.49k stars 2.49k forks source link

Feature request: Keep same letter combination for the same button/anchor text on following links via f #2011

Open k0pernikus opened 8 years ago

k0pernikus commented 8 years ago

As as vimium user, I always use links by pressing the f key and entering the relevant key combination. As a web surfer, I browse sites that have consistent naming of a buttons and anchor tags. Yet vimium applies different key combination for the same button values.

For example, github.com almost always has the button row: Watch, Unstar, and Fork.

Yet when I press f, "Fork" might get assigned SD or SF. So I can never trust a pageload to behave the same.

Or in pictures:

selection_141

selection_140

While this is nothing big of an issue for the github experience, I really got irked by it on the stackoverflow.com review queue, I can never be sure what combination to press to either Accept or Reject an edit. Sometimes skip is SS, then it is SD, then it is SE.

So as a feature request I kindly ask for vimium to be smart enough to keep to track the link key combination it has previously used for the same value of a button and anchor text to be able to just know the right shortcut for certain sites.h

gdh1995 commented 8 years ago

If you enable "Use the link's name and numbers for link-hint filtering" on Vimium Options page, then you may type a link's text to activate it.

smblott-github commented 8 years ago

Thanks, @k0pernikus. Unfortunately, I don't know a way to do this reliably.

(I use filtered hints to avoid this. With filtered hints, you know what to type before hitting f. And filtered hints scores links such that, if you start typing at the start of a link's text, it's pretty quickly selected.)

stephenh commented 7 years ago

Just musing, but one idea would be to let the user provide their own config.

E.g. on github.com, if any element matches the selector "#partial-new-comment-form-actions > button", map that to "c".

This user-configured list of "selector -> key" assignments could then be checked first, assign any links that match that first, and then continue with the existing/regular link -> keys assignment algorithm.

You could potentially make the user-provided config easy to add by adding an option to the right click menu, so I right click on "comment", go to "add vimium link hint assignment", and I get a dialog that provides the host url regex, defaults to the css selector from the "right click, inspect, copy as selector", and then a space to put your preferred key.

So, then on github I know "f c" is always comment, "f i" is issues or what not.

The problem would be that I just discovered the "use link names" advanced feature, which seems preferable for random websites and seldom used links, and sounds like I should use that most of the time.

Maybe I could keep f -> "use link names" mode and then (assuming this was implemented) setup F -> "the default way, but with these custom assignments" mode.

That way you could use either the "really fast hints I've custom setup" (F c, F i) or "the use names for other new/infrequent sites/links" (f <type link name> <enter>).