makew0rld / amfora

A fancy terminal browser for the Gemini protocol.
GNU General Public License v3.0
1.14k stars 65 forks source link

Open links using letter shortcuts #248

Open tomislavi opened 3 years ago

tomislavi commented 3 years ago

Please consider adding ability to open links using letter shortcuts instead of numeric ones. I feel that typing letters is faster then typing numbers. To illustrate what am I talking about here is video of how it works in Vimium plugin (https://github.com/philc/vimium) https://youtu.be/t67Sn0RGK54?t=24

makew0rld commented 3 years ago

Hmm, interesting. What are you picturing in terms of UI, like having [ab] next to links instead of [1]? I think it's a cool idea, although there would a bit more work needed to support double key presses, right now it's only programmed to work off one at a time.

I would accept a PR for this, as long as it still defaulted to the current behaviour and just provided this as a config option.

tomislavi commented 3 years ago

For the UI [ab] instead of [1] would be great. I think there is no need to support double key presses, user would type "a", and then "b". What is needed is special key (special mode) for opening links, like now you can press spacebar to open link/url/search. Problem with one key for link/url/search is that it is not possible to know does user want to search for "ab", or he wants to open link [ab]. But that problem already exists with numbers. Does the user want to open link number 9, or search for movie 9. e.g. Vimium has f to open link in same tab, F to open link in new tab. So, you press key to enter mode for opening links and type link shortcut. There is no need to confirm with enter key because link shortcuts are designed that way so it is possibile to know when user is done with entering. If there is shortcut [abc], there are no shortcuts [a] and [ab].

makew0rld commented 3 years ago

I think there is no need to support double key presses, user would type "a", and then "b".

Yes, sorry. I meant right now the application has no code that supports receiving one key, then waiting for another key before acting with a timeout. It can be done of course.

Otherwise sounds good.