-
-
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
Name the config keybindings that are used in every mode, to simplify the process of remapping them #527
Comments
@LeeBradley I understand under named keybindings that I can define keybinding groups similar to what alacritty allows. For example I have for my colorscheme in Alacritty # Colors (Modus)
schemes:
solarized-dark: &dark
# Default colors
primary:
background: '#002b36' # base03
foreground: '#839496' # base0
# Cursor colors
cursor:
text: '#002b36' # base03
cursor: '#839496' # base0
# Normal colors
normal:
black: '#073642' # base02
....
white: '#eee8d5' # base2
# Bright colors
bright:
black: '#002b36' # base03
...
white: '#fdf6e3' # base3
solarized-light: &light
# Default colors
primary:
background: '#fdf6e3' # base3
foreground: '#657b83' # base00
# Cursor colors
cursor:
text: '#fdf6e3' # base3
cursor: '#657b83' # base00
# Normal colors
normal:
black: '#002b36' # base03
...
white: '#eee8d5' # base2
# Bright colors
bright:
black: '#073642' # base02
...
white: '#fdf6e3' # base3
colors: *dark and switch beween them by simply changing to
|
@matu3ba You're correct that I'm not sure that YAML alias nodes would be helpful in this context, or I'm unsure of how they would help make the user's configuration overrides less verbose. |
Thank you for taking the time in creating this issue!
I am unsure if this is a syntax that is clear enough.
To be clearer the configuration then probably needs to look similar to this, and I think that
This seems slightly confusing, even though it is correct. I think an action that can toggle between multiple modes could make this clearer.
We could change the config to make use of the alias nodes, but I am pretty sure we don't want to do that. |
In #1036 we found a way to address this problem, without naming the keybindings. Thanks for all the great insight! |
The process of remapping a key is too "in the weeds".
As a practical example,
ctrl+r
is used by Zellij for pane resizing. Becausectrl+r
is already bound by bash's "reverse-i-search" and vim's "redo", I went to update the config file to replace thectrl+r
keybinding withctrl+y
.This required creating a
config.yaml
file, where I tripped up three times:My config file now:
I've only remapped one common keybinding, and I felt my
config.yaml
was a little long for that.Not only is it long, but now my
config.yaml
is tightly coupled with modes. This makes the configuration fragile. As soon as a new mode is added (for instance the new move mode in #164), my config file will "break" and I'll need to alter it to fix the resize keybinding in that mode.Proposed solution:
This is an example of how Zellij could make remapping a key relatively intuitive and short in a backwards-compatible manner.
To remap a single keybinding, a
config.yaml
file could contain only the following:Where the Zellij default.yaml keybindings in the codebase could be modified to look like this:
The neat part of this solution is that it is a non-breaking change that still allows users the specificity they had before, using the same syntax as before... but now there is an additional concept of
global
keybindings that work across modes.So users could still mix and match if they need to, for example:
Additional notes
If this this is done, it might be good to create a followup PR to update the documentation relating to keybindings the website: https://github.com/zellij-org/zellij-org.github.io
Post Edits:
named
toglobal
The text was updated successfully, but these errors were encountered: