rvcas / room

A Zellij plugin for quickly searching and switching tabs 🖤
MIT License
134 stars 14 forks source link

Fuzzy search keybinding conflicts #14

Closed MichaelXavier closed 1 month ago

MichaelXavier commented 1 month ago

Hi,

I've installed version 1.0.1 of room on zellij 0.40.1 with the following config:

copy_on_select true
simplified_ui true
theme "catppuccin-mocha"
default_shell "fish"
keybinds {
         locked {
                bind "Alt g" { SwitchToMode "Normal"; }
         }

         tab {
            bind "f" {
                 // Interatively find and switch to tabs
                LaunchOrFocusPlugin "file:~/.config/zellij/plugins/room.wasm" {
                    floating true;
                    ignore_case true;
                }
            }
         }

         shared_except "locked" {
                bind "Alt g" { SwitchToMode "locked"; }
         }
}

I want to call room with Ctrl+t f. It operates on tabs so it seems to make sense that it shows up under the tabs menu. This almost works but when I start typing a tab name, the keybindings for tab mode are still active. For example, if I type Ctrl+t f and then start typing "b" to search for tabs with the letter "b", the binding for "Break pane to new tab" is hit and my search is interrupted.

Any suggestions would be greatly appreciated.

MichaelXavier commented 1 month ago

I got a suggestion in the discord that ended up working. I set the mode back to normal mode after launching the plugin.

copy_on_select true
simplified_ui true
theme "catppuccin-mocha"
default_shell "fish"
keybinds {
         locked {
                bind "Alt g" { SwitchToMode "Normal"; }
         }

         tab {
            bind "f" {
                 // Interatively find and switch to tabs
                LaunchOrFocusPlugin "file:~/.config/zellij/plugins/room.wasm" {
                    floating true;
                    ignore_case true;
                }
                SwitchToMode "normal"
            }
         }

         shared_except "locked" {
                bind "Alt g" { SwitchToMode "locked"; }
         }
}
rvcas commented 1 week ago

@MichaelXavier is this working well for you? maybe we should update the read docs?

MichaelXavier commented 5 days ago

@rvcas It's working pretty well! Sorry for the delayed response. The only thing that's kind of janky is that when you do this to navigate to another tab, it will leave a floating window open in the tab that you came from. I switched to floating false. I typically keep one pane fullscreen, but when I switch using floating false, it will exit from fullscreen in the tab that I'm leaving. I suspect that room must spawn a panel in both cases and thus must leave fullscreen. This is good enough for me so I haven't pursued a way to further refine it. I think it'd be great to have something like this in the docs.

rvcas commented 5 days ago

@MichaelXavier i see