-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Refactor/streamline keybindings #1103
Conversation
Expand the documentation on some of the structs and functions to clarify their purpose in the parsing of the keybindings configuration. Also remove an intermediate struct once used for parsing that isn't referenced anywhere else in the code.
in favor of using the `default()` trait.
to all other keybinds. This ensures that the user has a consistent user experience and all the basic commands/movements (to switch modes, or the default "Alt"-bindings) can be changed in one place. If the need arises, specific bindings can still be overriden in the config file on a per-mode basis, as needed.
to test the feature manually from the CLI.
because the `normal`-mode bindings are now applied by default to all other modes, so the repetitions aren't necessary any longer.
Thank you for this work. I don't think we will benefit from this keybinding change, as #1036 proposes a much better solution, IMO. If you want to refactor the config part, I will gladly look at a refactor pr. |
Sure! To quote directly from #1036:
The |
Hmm, I guess then #1078 is obsolete as well, right? |
I think so, though if you think your reordering makes more sense I am happy to look over it at some point. It doesn't fundamentally change the configuration. |
Well, on to something new then... |
Streamlines the way the keybindings are read. While working on #1078 I realized that a lot of the bindings are redundant/repetitions of what is already bound in
normal
. This also means that merely changing keybindings to switch modes innormal
isn't sufficient, because the changes won't carry to other modes.This MR attempts to changes this by always applying the keybindings from the
normal
mode/section to all modes. This still gives the individual modes the ability to overwrite single keybindings with custom ones where needed.It's marked WIP because:
unbind
s, hence I had to excludeInputMode::Locked
from taking thenormal
bindings. I assume that this is due to the fact that I am overwriting the bindings after theunbind
s have been handled already? But I'm not quite sure about that because I find it a little hard to understand what exactly is going on in parts of the code with all theFrom
traits and stuff. :D