[Feature Request] Keybinds Per Buffer/Window Type/Class #128

Open
opened 2025-10-14 15:39:58 -06:00 by navan · 0 comments
Owner

Originally created by @fuguesoft on 3/30/2025

This request is a bit complicated to explain. Essentially I would like to be able to specify which commands go to which types of buffers/windows.

For example, from anywhere in normal mode, I could <S-j> to move the cursor down in the last active Rooms window. Conversely, <S-k> would move the cursor up. I could of course specify the bindings in my config:

[global_macros.normal]
channel_cursor = {
    target = "window_class.rooms"
    binding = {
        <S-j> = "cursor down"
        <S-k> = "cursor up"
    }
}

Another example would be being able to configure commands specifically for scrollback:

[global_macros.normal]
scrollback_cursor = {
    target = "window_class.scrollback"
    binding = {
        "a" = ":react" # React to a message
        "d" = ":redact<CR>" # Redact a message
        "e" = ":edit<CR>" # Edit a message
        "o" = ":open<CR>" # Open a link
        "r" = ":reply<CR>" # Reply to a message
    }
}

I don't know how the modes/windows/buffers are all configured now but it might be too extreme a rewrite to do something like this

*Originally created by @fuguesoft on 3/30/2025* This request is a bit complicated to explain. Essentially I would like to be able to specify which commands go to which types of buffers/windows. For example, from anywhere in normal mode, I could `<S-j>` to move the cursor down in the last active Rooms window. Conversely, `<S-k>` would move the cursor up. I could of course specify the bindings in my config: ```toml [global_macros.normal] channel_cursor = { target = "window_class.rooms" binding = { <S-j> = "cursor down" <S-k> = "cursor up" } } ``` Another example would be being able to configure commands specifically for scrollback: ```toml [global_macros.normal] scrollback_cursor = { target = "window_class.scrollback" binding = { "a" = ":react" # React to a message "d" = ":redact<CR>" # Redact a message "e" = ":edit<CR>" # Edit a message "o" = ":open<CR>" # Open a link "r" = ":reply<CR>" # Reply to a message } } ``` I don't know how the modes/windows/buffers are all configured now but it might be too extreme a rewrite to do something like this
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/iamb#128
No description provided.