Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

zellij setup #3

Open
ssipos90 opened this issue Sep 5, 2023 · 5 comments
Open

zellij setup #3

ssipos90 opened this issue Sep 5, 2023 · 5 comments

Comments

@ssipos90
Copy link

ssipos90 commented Sep 5, 2023

Hi,

I'm missing something out or is any necessary zellij config that one needs to setup for this plugin to work?

I'm coming from Navigator.nvim which I set up using <C-hjkl> for navigation.

Of all the keys only works, so something is off. This is my "normal" mode in zellij:

    normal clear-defaults=true {
        bind "Ctrl a" { SwitchToMode "Tmux"; }

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

I disabled Navigator.nvim in lazy.nvim and it shows disabled:

return {
  'numToStr/Navigator.nvim',
  lazy = false,
  enabled = vim.env.ZELLIJ == nil,
  keys = {
    { "<C-h>", '<cmd>NavigatorLeft<cr>',     { desc = "Navigator Left", mode = { "n", "t" } } },
    { "<C-l>", '<cmd>NavigatorRight<cr>',    { desc = "Navigator Right", mode = { "n", "t" } } },
    { "<C-k>", '<cmd>NavigatorUp<cr>',       { desc = "Navigator Up", mode = { "n", "t" } } },
    { "<C-j>", '<cmd>NavigatorDown<cr>',     { desc = "Navigator Down", mode = { "n", "t" } } },
    { "<C-p>", '<cmd>NavigatorPrevious<cr>', { desc = "Navigator Previous" } },
  },
  opts = {
    disable_on_zoom = true,
  }
}

and enabled zellij.nvim:

return {
  "Lilja/zellij.nvim",
  lazy = false,
  enabled = vim.env.ZELLIJ ~= nil,
  opts = {
    debug = true,
    vimTmuxNavigatorKeybinds = true,
    whichKeyEnabled = true,
  }
}

Thanks for your work!

edit:
this is the output of :checkhealth zellij

zellij: require("zellij.health").check()

zellij.nvim report ~
- Using binary 'zellij'
- OK Zellij binary found and version matches expected version number
- OK zellij 0.37.2
@Lilja
Copy link
Owner

Lilja commented Sep 5, 2023

@ssipos90 Thanks for your issue!

Does the :ZellijNavigateLeft or :ZellijNavigateRight commands work for you?

@ssipos90
Copy link
Author

ssipos90 commented Sep 5, 2023

yes, they do. interesting. could it be some neovim keymap conflict?

I ran :nmap and found the key bindings somewhere in the middle:

n  <C-K>       * <Cmd>ZellijNavigateUp<CR>
                 Navigate up vim window/zellij pane
n  <C-H>       * <Cmd>ZellijNavigateLeft<CR>
                 Navigate left vim window/zellij  pane
n  <C-J>       * <Cmd>ZellijNavigateDown<CR>
                 Navigate down vim window/zellij  pane

And way below at the bottom

n  <C-L>       * <Cmd>ZellijNavigateRight<CR>
                 Navigate right vim window/zellij pane

@Lilja
Copy link
Owner

Lilja commented Sep 5, 2023

It potentially be something with the latest PR i accepted. I saw that lazy.nvim has branch support so if you could try the revert-2-plugin branch and then add the setup function call.

@ssipos90
Copy link
Author

ssipos90 commented Sep 5, 2023

nah, it seems to still be the case with that branch.

return {
  "Lilja/zellij.nvim",
  branch = "revert-2-plugin",
  lazy = false,
  enabled = vim.env.ZELLIJ ~= nil,
  config = function()
    require("zellij").setup {
      vimTmuxNavigatorKeybinds = true,
      whichKeyEnabled = true,
      debug = true
    }
  end
}

from :Lazy

   ● zellij.nvim 1.35ms  start
        dir    /home/ssipos/.local/share/nvim/lazy/zellij.nvim
        url    https://github.com/Lilja/zellij.nvim
        branch revert-2-plugin
        commit 5ad77b1
        readme README.md

Also, I noticed ctrl-j sends a new line / enter. I found an opened issue here: zellij-org/zellij#2679

@Lilja
Copy link
Owner

Lilja commented Sep 6, 2023

All right, hmm.

To be honest I think this plugin works, but it might be that the experience of navigating from a pane that is not running neovim is not working.
See this issue for more details zellij-org/zellij#967

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants