nadrad / h-m-m

Hackers Mind Map
GNU General Public License v3.0
1.89k stars 53 forks source link

Feature request: make key bindings more Vim-like or allow users to remap key bindings #57

Closed qadzek closed 1 year ago

qadzek commented 1 year ago

Thank you for developing this wonderful application. Sometimes I have a hard time remembering the key bindings, so it would be helpful to make them more Vim-like, or to allow the user to remap the default key bindings.

Here are some ideas how I would remap the default key bindings (a couple are conflicting with current key bindings):

nadrad commented 1 year ago

Yeah... I'll add configuration. Although, it only accepts single key bindings now. I have to add key sequence binding as well anyway, because I'm running out of single keys for new features.

nadrad commented 1 year ago

OK, with the last two commits, it's become possible to configure key bindings, and you can also press '?' to see the current key bindings.

qadzek commented 1 year ago

Thanks a lot for adding this feature.

Just a small heads-up: bind end = save and bind home = save isn't working on my system, even though it's showing up when I press the ? key. Binding other keys works without issues.

nadrad commented 1 year ago

Pull the latest version, and with that, change the keys to home_alternative and end_alternative and see whether or not it works (and let me know).

If it didn't work, run h-m-m --echo-keys, press the "home" and "end" keys, see which code is shown on the top-left corner of the screen, and let me know.

qadzek commented 1 year ago

Adding _alternative doesn't solve this issue for my system. Pressing the Home key shows 33 133 61 176, pressing End displays 33 133 64 176. I wasn't really planning on remapping these keys anyway, I just noticed this while experimenting a bit.

nadrad commented 1 year ago

I don't know why your key codes for "home" and "end" keys are different from mine! Regardless, I've set the home_alternative and end_alternative values to those, in case someone needs them.