GR3YH4TT3R93 / zellij-nav.nvim

a Neovim plugin to help navigate betweeen Zellij panes as well as create new ones!
GNU General Public License v3.0
8 stars 1 forks source link

fix: update zellij action cmd to match default bindings/example #3

Closed JonnyLoughlin closed 1 month ago

JonnyLoughlin commented 1 month ago

Updated the zellij action command to move-focus-or-tab to match the behavior in the default and example zellij keybindings.

GR3YH4TT3R93 commented 1 month ago

Looks good but after looking at the docs, this should be able to be simplified to just use move-focus-or-tab as it already does the necessary checks. If you'd be willing to make the necessary changes, I'd be happy to merge!

JonnyLoughlin commented 1 month ago

I was basing this off the default Zellij keybindings found here

bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
bind "Alt j" "Alt Down" { MoveFocus "Down"; }
bind "Alt k" "Alt Up" { MoveFocus "Up"; }

MoveFocusOrTab also doesn't seem to work properly with Up and Down. For example, lets say you have two panes stacked vertically, and an additional tab open. If you do MoveFocusOrTab down in that top pane, you will move focus to the next tab, not to the pane below.

I actually just tested the following in my Zellij config:;

bind "Alt j" { MoveFocusOrTab "Down"; }
bind "Alt k" { MoveFocusOrTab "Up"; }

These bindings wont actually move up and down between panes. I tried with just two panes stacked on top of each other with no other tabs open and you can't navigate between them with MoveFocusOrTab.

Not sure if that would be considered a bug in Zellij, but I believe this behavior better matches Zellij.

GR3YH4TT3R93 commented 1 month ago

Sorry about that, after testing your solution is correct. Thank you for your contribution!