jmacdonald / amp

A complete text editor for your terminal.

Home Page:https://amp.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add support for different keys to trigger the same commands

adsick opened this issue · comments

commented

proposal

I am using bot Russian and English (Dvorak) layouts, so
the problem: is that when I'm using Russian - keybindings basically do nothing.
solution allow to mention list of keys that are treated equivalent in config yaml.

example:

j | о: cursor::move_down                                                                                                                                                                  
k | л: cursor::move_up                                                                                                                                                                    
h | р: cursor::move_left                                                                                                                                                                  
l | д: cursor::move_right

here the corresponding QWERTY-Russian default keys are used in Rust-match-like way. Probably not the most ergonomic thing ever (and I dunno how yaml works) but I hope you've got the concept: remove unnecessary repetition of key-mappings.
it would be too verbose to duplicate every command just to make another letter to trigger it.

commented

this also could be extended to things like f+j (meaning that you press f and j at the same time) to use in key-mappings.

Hi @adsick! YAML would support the j | о notation you proposed, we would just have to update the keybinding implementation to split the bindings on those characters and create multiple bindings in the process.

Flagging this as a feature request for the moment, but as you mentioned, this is technically possible (albeit verbose) today. Run the application::display_default_keymap command to get the current keybindings, paste them twice into the configuration, and then tweak one of the sets to match your preferences.

commented

@jmacdonald thanks for response, didn't knew this is possible, nice)