index : neolij.nvim
Seamless Neovim/Zellij integration with built-in navigation, pane/tab management, and Lua scripting.
about summary refs log tree commit diff
author y2w8 <yousefalharby416@gmail.com> 2026-04-15 20:46:37 +0300
committer y2w8 <yousefalharby416@gmail.com> 2026-04-15 20:46:37 +0300
commit 827d7615e188618cec05b67e5d688a0c6d9b7c42 [patch]
tree e14cb4af6cd498086ce2f0d8c5b778e2dd5c9e02
parent 3373823882fffc010d027ae8778e47f33c3037fe
download 827d7615e188618cec05b67e5d688a0c6d9b7c42.tar.gz

feat: add support for vim-zellij-navigator.

Diffstat

-rw-r--r-- README.md 99
-rw-r--r-- lua/neolij/init.lua 18
 2 files changed, 115 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 8b3aa32..07e6837 100644
--- a/README.md
+++ b/README.md
@@ -35,8 +35,12 @@
```

### Zellij
```kdl


<details>
  <summary>Autolock plugin</summary>

```kdl
keybinds clear-defaults=true {
    shared_except "locked" {
        bind "Ctrl left" { MoveFocusOrTab "left"; }
@@ -59,14 +63,107 @@
        // Print to Zellij log? (default=false)
        print_to_log false
    }

    // OR

    vim_zellij_navigator location="https://github.com/hiasr/vim-zellij-navigator/releases/download/0.3.0/vim-zellij-navigator.wasm"
}

// Plugins to load in the background when a new session starts
load_plugins {
    autolock
}
```
</details>

<details>
  <summary>vim-zellij-navigator plugin</summary>

> [!NOTE] 
> if you use `vim-zellij-navigator` you have to set `vim_zellij_navigator = true` in the configuration.
> ```lua
> require("neolij").setup({
>   vim_zellij_navigator = true
> })
> ```

```kdl
keybinds clear-defaults=true {
    shared_except "locked" {
        bind "Ctrl j" {
            MessagePlugin "vim_zellij_navigator" {
                name "move_focus";
                payload "down";

                move_mod "ctrl";
                use_arrow_keys "false";
            };
        }

        bind "Ctrl k" {
            MessagePlugin "vim_zellij_navigator" {
                name "move_focus";
                payload "up";

                move_mod "ctrl";
                use_arrow_keys "false";
            };
        }

        bind "Ctrl l" {
            MessagePlugin "vim_zellij_navigator" {
                name "move_focus_or_tab";
                payload "right";

                move_mod "ctrl"; // Optional, should be added on every command if you want to use it
                use_arrow_keys "false";
            };
        }

        bind "Alt h" {
            MessagePlugin "vim_zellij_navigator" {
                name "resize";
                payload "left";

                resize_mod "alt"; 
            };
        }

        bind "Alt j" {
            MessagePlugin "vim_zellij_navigator" {
                name "resize";
                payload "down";

                resize_mod "alt";
            };
        }

        bind "Alt k" {
            MessagePlugin "vim_zellij_navigator" {
                name "resize";
                payload "up";

                resize_mod "alt";
            };
        }

        bind "Alt l" {
            MessagePlugin "vim_zellij_navigator" {
                name "resize";
                payload "right";

                resize_mod "alt";
            };
        }
    }
}

plugins {
    vim_zellij_navigator location="https://github.com/hiasr/vim-zellij-navigator/releases/download/0.3.0/vim-zellij-navigator.wasm"
}
```
</details>



## Commands
diff --git a/lua/neolij/init.lua b/lua/neolij/init.lua
index 49a186e..72e3cc0 100644
--- a/lua/neolij/init.lua
+++ b/lua/neolij/init.lua
@@ -6,6 +6,14 @@
	left = "h",
	right = "l",
}

local default_config = {
  -- if use vim-zellij-navigator plugin set this to true.
  vim_zellij_navigator = false
}

M.config = {}

-- Run zellij action safely
function M.zellij_action(args)
	if not os.getenv("ZELLIJ") then
@@ -125,7 +133,15 @@
end

-- Setup user commands
function M.setup()
function M.setup(user_config)
  M.config = vim.tbl_deep_extend("force", default_config, user_config or {})
  if M.config.vim_zellij_navigator then
    vim.fn.jobstart('zellij pipe -n "nvim_hook" "open"')
    vim.api.nvim_create_autocmd({"VimLeavePre"}, {
        pattern = {"*"},
        command = 'zellij pipe -n "nvim_hook" "close"'
    })
  end
	vim.api.nvim_create_user_command("NeolijUp", function()
		M.move("up")
	end, {})