firecat53 / urlscan

Mutt and terminal url selector (similar to urlview)
GNU General Public License v2.0
213 stars 37 forks source link

Customize hotkeys? #72

Closed 097115 closed 5 years ago

097115 commented 6 years ago

Would be great to have a chance to customize not only colorschemes but also map your own hotkeys in a config file.

firecat53 commented 6 years ago

I'll take a look. It'll required reworking the way the keys are handled.

rslindee commented 5 years ago

I, too, think this would be an great feature!

Personally, I don't like the idea of a config file being generated from a (potentially accidental) keypress and would like to unmap such a feature.

firecat53 commented 5 years ago

Pushed some changes to the develop branch that allow editing keybindings in config.json. Give it a try and let me know how it works!

rslindee commented 5 years ago

Thank you for pursuing this!

Some feedback:

Thank you again and I hope you find this feedback useful.

firecat53 commented 5 years ago

I probably need to make it more obvious in the docs, but you need to unmap a key by setting it to "", then remapping it to something else. This should take care of your first two points, I hope. I'm already working on fixing the last point. Thanks!

rslindee commented 5 years ago

Hmmm, I tried unmapping the "config_create" key per your suggestion, but the original mapping persists. For example, if I have the following lines:

    "": "config_create",
    "x": "config_create",

"P" still calls "config_create".

firecat53 commented 5 years ago

Oh, sorry! You need to set "P": "" to unset P. That might help :D I didn't immediately notice you had it backwards!

firecat53 commented 5 years ago

Pushed another commit to develop with significant modifications in displaying help menu, including dynamic keybindings. Let me know how it works!

097115 commented 5 years ago

Looks good, thanks!

The only question I have, would it be very difficult to add another hotkey (in addition to <Enter>) for actually opening a link? Here's the workflow I have in mind: let's say, from Mutt, you launch urlscan with -- let it be -- <F2>, then select a link you want to launch with navigation keys, and then, if you defined this alternative launcher, press the same <F2> again to open the selected link -- so that you literally don't have to move your left hand :)

Sure, if it's too much work, then simply don't bother. And thanks again!

rslindee commented 5 years ago

No worries, I realize I definitely made some goofy assumptions with the key remapping behavior (busy day yesterday). I just tried your latest changes and it looks great.

Thank you for implementing these suggestions and being so patient!

firecat53 commented 5 years ago

@097115 I added the ability to assign another key to open URLs. Just so you know, both space and enter work by default (added to docs). Let me know if that works for you (develop branch).

@rslindee great! Thanks for testing.

097115 commented 5 years ago

That's great, thanks! (Have done a bit of testing already, everything seems OK)

You will close the issue after pushing it to master?