feat(pane-nav): smart-splits under tmux, pane_nav for herdr/kitty

This commit is contained in:
root committed 2026-11-02 10:46:21 -05:00
1 parent 3a0e1cb13e
commit 7d448348b2
4 files changed
+50 -13

No files matched your search

+1 -2
View File
@@ -65,7 +65,7 @@ scripts/ mermaid-validator.mjs (node process used by config/mermai
**Search**: `fff.nvim` handles files and grep (frecency, respects `.gitignore` and `.ignore`). snacks.picker handles everything else. `config/ignore_patterns.lua` holds the shared ignore list used by neo-tree and the snacks pickers.
**Pane navigation** (`config/pane_nav.lua`): `<C-h/j/k/l>` moves between Neovim splits first. At the outermost split, the move goes to herdr, tmux, or kitty, whichever is the nearest ancestor process. Resize is plain `:resize` on `<C-Up/Down/Left/Right>`; smart-splits is disabled.
**Pane navigation** (`config/pane_nav.lua`): `<C-h/j/k/l>` moves between Neovim splits first. At the outermost split, the move goes to herdr, tmux, or kitty, whichever is the nearest ancestor process. Under tmux the move goes through smart-splits.nvim, loaded at startup, which flags the pane `@pane-is-vim` for `tmux.conf`. There, `<C-Up/Down/Left/Right>` and `<M-h/j/k/l>` are smart-splits resize and cross into tmux panes at the edge. Elsewhere smart-splits stays unloaded and resize is plain `:resize` on `<C-Up/Down/Left/Right>`.
**Mermaid** (`config/mermaid.lua`): tree-sitter highlights ```` ```mermaid ```` fences in markdown/MDX and `.mmd` files. Diagnostics come from mermaid's own parser running in a node process, which exits after 5 idle minutes. Run `:MermaidCheck` to re-validate.
@@ -82,7 +82,6 @@ Core or community plugins turned off in `plugins/user.lua` because something els
| Plugin | Replaced by |
| --- | --- |
| `none-ls.nvim`, `mason-null-ls.nvim` | conform (`mason-null-ls` would auto-register every Mason tool as a second formatter/linter client) |
| `smart-splits.nvim` | `config/pane_nav.lua` + native `:resize` |
| `toggleterm.nvim` | kitty / snacks terminals |
| `lsp_signature.nvim` (not imported) | astrolsp's built-in signature help (`features.signature_help = true`) |
| `refactoring.nvim`, `dev-tools.nvim` (not imported) | LSP code actions (`<C-a>a`) |
+5
View File
@@ -141,6 +141,11 @@ end
--- @param dir "left"|"down"|"up"|"right"
function M.navigate(dir)
local from = vim.api.nvim_get_current_win()
-- Under tmux smart-splits owns the edge handoff (plugins/user.lua).
if M.env() == "tmux" and vim.api.nvim_win_get_config(from).relative == "" then
require("smart-splits")["move_cursor_" .. dir]()
return
end
vim.cmd.wincmd(directions[dir].wincmd)
if vim.api.nvim_get_current_win() ~= from then return end
if vim.api.nvim_win_get_config(0).relative ~= "" then return end
+29 -9
View File
@@ -1,10 +1,11 @@
--- <C-h/j/k/l> pane navigation that follows whatever multiplexer Neovim is
--- running under (herdr, tmux, or bare kitty) — see config.pane_nav.
---
--- This replaces AstroNvim's smart-splits mappings (which only know
--- tmux/wezterm/kitty and would move the wrong layer inside herdr). The plugin
--- is disabled in plugins/user.lua; its <C-Up/Down/Left/Right> resize binds
--- are plain :resize here.
--- These entries overwrite AstroNvim's smart-splits mappings, which only know
--- tmux/wezterm/kitty and would move the wrong layer inside herdr. Under tmux
--- they hand back to smart-splits: navigation through config.pane_nav, resize
--- directly, plus <M-h/j/k/l> resize, the keys tmux.conf forwards to an
--- @pane-is-vim pane. Elsewhere <C-Up/Down/Left/Right> are plain :resize.
local nav = require "config.pane_nav"
@@ -18,11 +19,20 @@ local moves = {
}
--- AstroNvim's key spelling again, overriding the smart-splits resize entries.
--- dir is the smart-splits direction under tmux; cmd the plain fallback.
local resizes = {
["<C-Up>"] = { "resize +2", "Resize split taller" },
["<C-Down>"] = { "resize -2", "Resize split shorter" },
["<C-Left>"] = { "vertical resize -2", "Resize split narrower" },
["<C-Right>"] = { "vertical resize +2", "Resize split wider" },
["<C-Up>"] = { dir = "up", cmd = "resize +2", desc = "Resize split taller" },
["<C-Down>"] = { dir = "down", cmd = "resize -2", desc = "Resize split shorter" },
["<C-Left>"] = { dir = "left", cmd = "vertical resize -2", desc = "Resize split narrower" },
["<C-Right>"] = { dir = "right", cmd = "vertical resize +2", desc = "Resize split wider" },
}
--- tmux.conf's vim-aware resize keys; only mapped under tmux.
local tmux_resizes = {
["<M-h>"] = "left",
["<M-j>"] = "down",
["<M-k>"] = "up",
["<M-l>"] = "right",
}
return {
@@ -36,8 +46,18 @@ return {
maps.x[key] = maps.n[key]
maps.t[key] = { nav.terminal(dir), desc = desc }
end
local tmux = nav.env() == "tmux"
for key, spec in pairs(resizes) do
maps.n[key] = { "<Cmd>" .. spec[1] .. "<CR>", desc = spec[2] }
if tmux then
maps.n[key] = { function() require("smart-splits")["resize_" .. spec.dir]() end, desc = "Resize split " .. spec.dir }
else
maps.n[key] = { "<Cmd>" .. spec.cmd .. "<CR>", desc = spec.desc }
end
end
if tmux then
for key, dir in pairs(tmux_resizes) do
maps.n[key] = { function() require("smart-splits")["resize_" .. dir]() end, desc = "Resize split " .. dir .. " (tmux aware)" }
end
end
end,
}
+15 -2
View File
@@ -53,8 +53,21 @@ return {
{ "nvimtools/none-ls.nvim", enabled = false },
{ "jay-babu/mason-null-ls.nvim", enabled = false },
-- <C-h/j/k/l> is config.pane_nav; resize binds are native (plugins/pane-nav.lua)
{ "mrjones2014/smart-splits.nvim", enabled = false },
-- Under tmux, smart-splits drives <C-h/j/k/l> and resizing (config.pane_nav
-- and plugins/pane-nav.lua delegate to it) and flags the pane @pane-is-vim
-- for tmux.conf. herdr and kitty stay on config.pane_nav, so its env() picks
-- the integration instead of smart-splits' own env-var guess. Loaded at
-- startup under tmux so the flag is set before the first keypress
-- (AstroNvim's early load keys off TERM_PROGRAM, which tmux.conf passes
-- through from the outer terminal).
{
"mrjones2014/smart-splits.nvim",
lazy = require("config.pane_nav").env() ~= "tmux",
opts = function(_, opts)
opts.at_edge = "wrap"
opts.multiplexer_integration = require("config.pane_nav").env() == "tmux" and "tmux" or false
end,
},
-- lsp_signature.nvim is gone; astrolsp's own signature help replaces it
{ "AstroNvim/astrolsp", opts = { features = { signature_help = true } } },