From 389c777498c777343009d47af1cedbef7ed36a1d Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Thu, 26 Oct 2023 09:25:26 -0600 Subject: [PATCH] README updates - add section on configuring Zellij and its known issues - fix grammar here and there --- README.md | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 523c350..c0b7c91 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # zellij-nav.nvim -This is a Neovim plugin which integrates window navigation with +This is a Neovim plugin, which integrates window navigation with [zellij](https://github.com/zellij-org/zellij). -It creates four new commands which will move between windows inside Neovim -(like `^w h` et. al.), but once it hits the edge of your editor it will attempt +It creates four new commands, which will move between windows inside Neovim +(like `^w h` et al.), but once it hits the edge of your editor it will attempt to switch to the next zellij pane. Commands: @@ -74,6 +74,33 @@ nnoremap ZellijNavigateUp nnoremap ZellijNavigateRight ``` +## Configuring Zellij + +This plugin only covers the Neovim side of things. To get to a fully +seamless workflow, we need zellij to do a few things too. + +In an ideal world, we could map `C-hjkl` to work identically across both zellij +and Neovim, but that's not possible. Unfortunately, today, zellij has a few +problems, which prevent us from getting to that point. + +First, zellij doesn't allow us to bind `C-j` to anything. This is a [known bug](https://github.com/zellij-org/zellij/issues/2679). + +Second, and more critically, upon any of the `C-hjkl` keystrokes in zellij, we +need to be able to: + +1. Determine whether the focussed pane is running `nvim`. +2. If so, forward the keystrokes to the application; for example, using the + zellij `Write` action. +3. If not, act on the keystroke directly in zellij by using the `MoveFocus + ` action. + +Presently, I have not figured out a way to do this, even through the [zellij plugin system](https://zellij.dev/documentation/plugins). + +Thus, my configuration uses `A-hjkl` in zellij. So, I use `C-hjkl` to move +around within Neovim, and to move from Neovim to another zellij pane. But if +I'm in a non-`nvim` zellij pane, I just use `A-hjkl` to switch panes. It's not +ideal, but it's the best I know today. + ## MIT License Copyright © 2023 Stephen Waits