-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Allow composition of configs to avoid duplication #1513
Comments
Duplicate of #1498 |
Not sure these is a duplicate. Let's assume I want to do the following:
You suggestion in the other issue (which fits this one better) would be to allow me to set [keys.normal.'space']
'k' = 'my_Custom_Command_That_Is_Actually_A_Minor_Mode_Of_10_Commands_With_A_Name'
[keys.normal.'c-w']
'k' = 'my_Custom_Command_That_Is_Actually_A_Minor_Mode_Of_10_Commands_With_A_Name'
[keys.select.'space']
'k' = 'my_Custom_Command_That_Is_Actually_A_Minor_Mode_Of_10_Commands_With_A_Name'
[keys.select.'c-w']
'k' = 'my_Custom_Command_That_Is_Actually_A_Minor_Mode_Of_10_Commands_With_A_Name'
[keys.select.'x'] # my custom minor mode
'a' = 'delete_char_forward' # builtin commands
'b' = 'delete_selection' # builtin commands
'c' = 'delete_selection_noyank' # builtin commands
'k' = 'my_Custom_Command_That_Is_Actually_A_Minor_Mode_Of_10_Commands_With_A_Name' and then if I replace those 10 commands in this minor key mode with something else, I wouldn't even have to change anything here |
Oh, so you mean like being able to define an alias for a list of commands. In the proposed format in the other issue, this would still be moderately better: [keys]
"<Space>.ns" = { k = { ... } }
C-w.ns = { k = { ... } }
x.ns = { k = { ... } } but yeah I see what you mean, it would help to be able to use an alias. Could be something like: [alias]
my-alias = [ "a", "b", ... ]
[keys]
"<Space>.ns" = { k = "my-alias" }
C-w.ns = { k = "my-alias" }
x.ns = { k = "my-alias" } |
Yep, that would be great to have and is what I meant in the other issue: I set a list once and then refer to it via an alias The solution to this issue would then allow you to set regular keys in various modes with a dot-mode |
By the way, aliases might help solve this issue #1499 as well — I can map a command to call an alias it's defined in to make the dialog "sticky", but only for come commands [my-space-mode-alias]
"a" = "a_cmd" # dialog closes once this command is run
"b" = "b_cmd" # same
"c" = ["c_cmd", # dialog remains open after this one,
"my-space-mode-alias"] # making this key "Sticky"
[keys]
'space'.ns = 'my-space-mode-alias' |
Very interesting idea |
Duplicate of #1752 |
The other issues is about missing display labels, not internal composition references /aliases, so not a dupe |
yeah I lost track of the small differences between different issuse so I am going to keep this one closed. This will be adressed once we switch to a scheme based config (#10389) |
Currently if you change a lot of normal mode keybinds (e.g., change the GoTo mode as
[keys.normal."g"]
), you'd have to copy these changes several times to other modes so they keep working there (e.g., as[keys.select."g"]
since), which is rather cumbersome, especially when you tweak the configs.The source code uses a nifty
let mut select = normal.clone();
trick that allows only editing the keybinds that are differentWould you please allow a similar ease of composition for the user configs?
The text was updated successfully, but these errors were encountered: