GithubHelp home page GithubHelp logo

zellij.nvim's Issues

zellij setup

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

Could not get navigation working

Hi! thank you for this wonderful plugin!

I followed the instructions on the README but could not get navigation to work.
Using the commands: ZellijNavigationLeft, ZellijNavigationRight, ZellijNavigationUp work, but ZellijNavigationDown does not, it gives the following error: E464: Ambiguous use of user-defined command
I'm using LazyVim, and have the following settings under ~/.conifg/nvim/lua/plugins/zellij.lua:

return {
  {
    "Lilja/zellij.nvim",
    opts = {
      debug = true,
    },
  },
}

this is my zellij config, the only changes from the original config are rebinding everything from CTRL to ALT to avoid conflict of shortcuts with neovim, remove panel frame with panel_frames: false and adding catppuccin theme

config
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
keybinds clear-defaults=true {
    unbind "Ctrl h"
    unbind "Ctrl j"
    unbind "Ctrl k"
    unbind "Ctrl l"
    normal {
        // uncomment this and adjust key if using copy_on_select=false
        // bind "Alt c" { Copy; }
    }
    locked {
        bind "Alt g" { SwitchToMode "Normal"; }
    }
    resize {
        bind "Alt n" { SwitchToMode "Normal"; }
        bind "h" "Left" { Resize "Increase Left"; }
        bind "j" "Down" { Resize "Increase Down"; }
        bind "k" "Up" { Resize "Increase Up"; }
        bind "l" "Right" { Resize "Increase Right"; }
        bind "H" { Resize "Decrease Left"; }
        bind "J" { Resize "Decrease Down"; }
        bind "K" { Resize "Decrease Up"; }
        bind "L" { Resize "Decrease Right"; }
        bind "=" "+" { Resize "Increase"; }
        bind "-" { Resize "Decrease"; }
    }
    pane {
        bind "Alt p" { SwitchToMode "Normal"; }
        bind "h" "Left" { MoveFocus "Left"; }
        bind "l" "Right" { MoveFocus "Right"; }
        bind "j" "Down" { MoveFocus "Down"; }
        bind "k" "Up" { MoveFocus "Up"; }
        bind "p" { SwitchFocus; }
        bind "n" { NewPane; SwitchToMode "Normal"; }
        bind "d" { NewPane "Down"; SwitchToMode "Normal"; }
        bind "r" { NewPane "Right"; SwitchToMode "Normal"; }
        bind "x" { CloseFocus; SwitchToMode "Normal"; }
        bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
        bind "z" { TogglePaneFrames; SwitchToMode "Normal"; }
        bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
        bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }
        bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;}
    }
    move {
        bind "Alt m" { SwitchToMode "Normal"; }
        bind "n" "Tab" { MovePane; }
        bind "p" { MovePaneBackwards; }
        bind "h" "Left" { MovePane "Left"; }
        bind "j" "Down" { MovePane "Down"; }
        bind "k" "Up" { MovePane "Up"; }
        bind "l" "Right" { MovePane "Right"; }
    }
    tab {
        bind "Alt t" { SwitchToMode "Normal"; }
        bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; }
        bind "h" "Left" "Up" "k" { GoToPreviousTab; }
        bind "l" "Right" "Down" "j" { GoToNextTab; }
        bind "n" { NewTab; SwitchToMode "Normal"; }
        bind "x" { CloseTab; SwitchToMode "Normal"; }
        bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; }
        bind "1" { GoToTab 1; SwitchToMode "Normal"; }
        bind "2" { GoToTab 2; SwitchToMode "Normal"; }
        bind "3" { GoToTab 3; SwitchToMode "Normal"; }
        bind "4" { GoToTab 4; SwitchToMode "Normal"; }
        bind "5" { GoToTab 5; SwitchToMode "Normal"; }
        bind "6" { GoToTab 6; SwitchToMode "Normal"; }
        bind "7" { GoToTab 7; SwitchToMode "Normal"; }
        bind "8" { GoToTab 8; SwitchToMode "Normal"; }
        bind "9" { GoToTab 9; SwitchToMode "Normal"; }
        bind "Tab" { ToggleTab; }
    }
    scroll {
        bind "Alt s" { SwitchToMode "Normal"; }
        bind "e" { EditScrollback; SwitchToMode "Normal"; }
        bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; }
        bind "Alt c" { ScrollToBottom; SwitchToMode "Normal"; }
        bind "j" "Down" { ScrollDown; }
        bind "k" "Up" { ScrollUp; }
        bind "Alt f" "PageDown" "Right" "l" { PageScrollDown; }
        bind "Alt b" "PageUp" "Left" "h" { PageScrollUp; }
        bind "d" { HalfPageScrollDown; }
        bind "u" { HalfPageScrollUp; }
        // uncomment this and adjust key if using copy_on_select=false
        // bind "Alt c" { Copy; }
    }
    search {
        bind "Alt s" { SwitchToMode "Normal"; }
        bind "Alt c" { ScrollToBottom; SwitchToMode "Normal"; }
        bind "j" "Down" { ScrollDown; }
        bind "k" "Up" { ScrollUp; }
        bind "Alt f" "PageDown" "Right" "l" { PageScrollDown; }
        bind "Alt b" "PageUp" "Left" "h" { PageScrollUp; }
        bind "d" { HalfPageScrollDown; }
        bind "u" { HalfPageScrollUp; }
        bind "n" { Search "down"; }
        bind "p" { Search "up"; }
        bind "c" { SearchToggleOption "CaseSensitivity"; }
        bind "w" { SearchToggleOption "Wrap"; }
        bind "o" { SearchToggleOption "WholeWord"; }
    }
    entersearch {
        bind "Alt c" "Esc" { SwitchToMode "Scroll"; }
        bind "Enter" { SwitchToMode "Search"; }
    }
    renametab {
        bind "Alt c" { SwitchToMode "Normal"; }
        bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; }
    }
    renamepane {
        bind "Alt c" { SwitchToMode "Normal"; }
        bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; }
    }
    session {
        bind "Alt o" { SwitchToMode "Normal"; }
        bind "Alt s" { SwitchToMode "Scroll"; }
        bind "d" { Detach; }
    }
    tmux {
        bind "[" { SwitchToMode "Scroll"; }
        bind "Alt b" { Write 2; SwitchToMode "Normal"; }
        bind "\"" { NewPane "Down"; SwitchToMode "Normal"; }
        bind "%" { NewPane "Right"; SwitchToMode "Normal"; }
        bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
        bind "c" { NewTab; SwitchToMode "Normal"; }
        bind "," { SwitchToMode "RenameTab"; }
        bind "p" { GoToPreviousTab; SwitchToMode "Normal"; }
        bind "n" { GoToNextTab; SwitchToMode "Normal"; }
        bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; }
        bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; }
        bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; }
        bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; }
        bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; }
        bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; }
        bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; }
        bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; }
        bind "o" { FocusNextPane; }
        bind "d" { Detach; }
        bind "Space" { NextSwapLayout; }
        bind "x" { CloseFocus; SwitchToMode "Normal"; }
    }
    shared_except "locked" {
        bind "Alt g" { SwitchToMode "Locked"; }
        bind "Alt q" { Quit; }
        bind "Alt n" { NewPane; }
        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"; }
        bind "Alt =" "Alt +" { Resize "Increase"; }
        bind "Alt -" { Resize "Decrease"; }
        bind "Alt [" { PreviousSwapLayout; }
        bind "Alt ]" { NextSwapLayout; }
    }
    shared_except "normal" "locked" {
        bind "Enter" "Esc" { SwitchToMode "Normal"; }
    }
    shared_except "pane" "locked" {
        bind "Alt p" { SwitchToMode "Pane"; }
    }
    shared_except "resize" "locked" {
        bind "Alt n" { SwitchToMode "Resize"; }
    }
    shared_except "scroll" "locked" {
        bind "Alt s" { SwitchToMode "Scroll"; }
    }
    shared_except "session" "locked" {
        bind "Alt o" { SwitchToMode "Session"; }
    }
    shared_except "tab" "locked" {
        bind "Alt t" { SwitchToMode "Tab"; }
    }
    shared_except "move" "locked" {
        bind "Alt m" { SwitchToMode "Move"; }
    }
    shared_except "tmux" "locked" {
        bind "Alt b" { SwitchToMode "Tmux"; }
    }
}

plugins {
    tab-bar { path "tab-bar"; }
    status-bar { path "status-bar"; }
    strider { path "strider"; }
    compact-bar { path "compact-bar"; }
}

// Catppuccin Theme:
// https://github.com/catppuccin/catppuccin
theme "catppuccin-mocha"

themes {
  catppuccin-latte {
    bg "#acb0be" // Surface2
    fg "#acb0be" // Surface2
    red "#d20f39"
    green "#40a02b"
    blue "#1e66f5"
    yellow "#df8e1d"
    magenta "#ea76cb" // Pink
    orange "#fe640b" // Peach
    cyan "#04a5e5" // Sky
    black "#dce0e8" // Crust
    white "#4c4f69" // Text
  }

  catppuccin-frappe {
    bg "#626880" // Surface2
    fg "#c6d0f5"
    red "#e78284"
    green "#a6d189"
    blue "#8caaee"
    yellow "#e5c890"
    magenta "#f4b8e4" // Pink
    orange "#ef9f76" // Peach
    cyan "#99d1db" // Sky
    black "#292c3c" // Mantle
    white "#c6d0f5"
  }

  catppuccin-macchiato {
    bg "#5b6078" // Surface2
    fg "#cad3f5"
    red "#ed8796"
    green "#a6da95"
    blue "#8aadf4"
    yellow "#eed49f"
    magenta "#f5bde6" // Pink
    orange "#f5a97f" // Peach
    cyan "#91d7e3" // Sky
    black "#1e2030" // Mantle
    white "#cad3f5"
  }

  catppuccin-mocha {
    bg "#585b70" // Surface2
    fg "#cdd6f4"
    red "#f38ba8"
    green "#a6e3a1"
    blue "#89b4fa"
    yellow "#f9e2af"
    magenta "#f5c2e7" // Pink
    orange "#fab387" // Peach
    cyan "#89dceb" // Sky
    black "#181825" // Mantle
    white "#cdd6f4"
  }
}

// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP
// eg. when terminal window with an active zellij session is closed
// Options:
//   - detach (Default)
//   - quit
//
// on_force_close "quit"

//  Send a request for a simplified ui (without arrow fonts) to plugins
//  Options:
//    - true
//    - false (Default)
//
// simplified_ui true


// Toggle between having pane frames around the panes
// Options:
//   - true (default)
//   - false
//
// pane_frames true

// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible
// Options:
//   - true (default)
//   - false
//
// auto_layout true

pane_frames false

// The name of the default layout to load on startup
// Default: "default"
//
// default_layout "compact"

// Choose the mode that zellij uses when starting up.
// Default: normal
//
// default_mode "locked"


// Configure the scroll back buffer size
// This is the number of lines zellij stores for each pane in the scroll back
// buffer. Excess number of lines are discarded in a FIFO fashion.
// Valid values: positive integers
// Default value: 10000
//
// scroll_buffer_size 10000

// Path to the default editor to use to edit pane scrollbuffer
// Default: $EDITOR or $VISUAL
//
// scrollback_editor "/usr/bin/vim"

// When attaching to an existing session with other users,
// should the session be mirrored (true)
// or should each user have their own cursor (false)
// Default: false
//
// mirror_session true

// The folder in which Zellij will look for layouts
//
// layout_dir "/path/to/my/layout_dir"

// The folder in which Zellij will look for themes
//
// theme_dir "/path/to/my/theme_dir"

Here are the logs from /tmp/
~
❯ tail -f /tmp/zellij-1000/zellij-log/*
==> /tmp/zellij-1000/zellij-log/zellij-12.log <==
%                                                                                     ~
❯

==> /tmp/zellij-1000/zellij-log/zellij.log <==
ERROR  |zellij_utils::errors::not| 2023-11-23 14:27:59.089 [async-std/runti] [zellij-utils/src/errors.rs:601]: Panic occured:
             thread: async-std/runtime
             location: At zellij-server/src/plugins/wasm_bridge.rs:369:72
             message: called `Result::unwrap()` on an `Err` value: PoisonError { .. }
INFO   |zellij_client            | 2023-11-23 14:28:00.871 [main      ] [zellij-client/src/lib.rs:143]: Starting Zellij client!
INFO   |zellij_server            | 2023-11-23 14:28:00.874 [main      ] [zellij-server/src/lib.rs:237]: Starting Zellij server!
INFO   |zellij_server            | 2023-11-23 14:28:00.929 [main      ] [zellij-server/src/lib.rs:862]: Compiling plugins using Cranelift
INFO   |zellij_server::plugins   | 2023-11-23 14:28:00.929 [wasm      ] [zellij-server/src/plugins/mod.rs:124]: Wasm main thread starts
INFO   |zellij_server::plugins::p| 2023-11-23 14:28:00.945 [async-std/runti] [zellij-server/src/plugins/plugin_loader.rs:595]: Loaded plugin 'tab-bar' from cache folder at '/home/amit/.cache/zellij' in 7.370168ms
INFO   |zellij_server::plugins::p| 2023-11-23 14:28:00.949 [async-std/runti] [zellij-server/src/plugins/plugin_loader.rs:595]: Loaded plugin 'status-bar' from cache folder at '/home/amit/.cache/zellij' in 10.295266ms

What am I missing?

Thank you for the help!

zellij overrides the keybinds when same are used in nvim

I've bound Ctrl + h/j/k/l to ZellijNavigate... in nvim and the same bind for moving through panes in zellij,
however the zellij keybind overrides the nvim one and I can't move between windows inside of nvim anymore.
This probably has something to do with zellij recognizing the current pane is running nvim and therefore needs to somehow unhook those keybinds, to allow for nvim to use it's own.
I'm sure this is a common problem, however I couldn't find a solution.
Any help? :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.