-
-
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
Key remapping for compositor components #5505
Comments
hi! would this be applicable to command output popups #5923 (comment) too? |
Yep, the |
hey! currently
so, this concept of being able to "remap" is there in all of the above issues, but the following thing seems to be not discussed. how about having
That is, there will be 3 groups of actions for a general component:
|
I wasn't happy with the scroll-in popup keymaps, because while in insert mode, if an autocompletion popup suggestion is open, I cannot use the So I opened my config file and typed this by instinct: [keys.popup]
C-u = "no_op"
C-d = "no_op"
C-j = "scroll_down"
C-k = "scroll_up" and got the following error: I'm discovering with this issue that it is not possible yet to remap those keys, but I want to sat that your design suggestion for the config is right imo |
have had some more time to experiment with this, what I am currently doing is name spacing the commands by adding the module name to the start of the command so currently it allows remapping for the picker, buffer-picker and menu, I can implement the rest of the components if we want as well, branch is here built on the great work of @the-mikedavis : https://github.com/gabydd/helix/tree/md-compositor-key-remapping-idea change for namespaced version of compositor command namingdiff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index ecd4ad42..b2e4fdad 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -209,7 +209,7 @@ macro_rules! component_commands {
paste! {
#[allow(non_upper_case_globals)]
pub const [<$second _ $name>]: Self = Self::Component {
- name: stringify!([<$second _ $name>]),
+ name: concat!(stringify!($second), "::", stringify!($name)),
fun: $first::$second::$name,
doc: $doc
}; |
Really looking forward to the key bindings, when will they happen? |
There are some prior issues on this for pickers, prompts, and popups. This issue is meant to be a tracking issue for key remapping for any
Component
. Ideally you should be able to remap any actions for any component (pickers, prompts, menus, etc.). I think that the solution to remapping for one component should be the same or very similar to the solution for remapping any component so this issue covers all components.This is a little tricky implementation-wise: regular commands share the same function signature that takes a
&mut Context
. Component commands are currently built straight into each component. For example see scrolling a popup:helix/helix-term/src/ui/popup.rs
Lines 186 to 193 in 2412f7c
This will also take some design work to decide how the config should look. I am imagining something like:
The text was updated successfully, but these errors were encountered: