Move nvim window dimming from per-split to whole-pane
Dim signals "nvim is not the active terminal pane", not "this split is not current". Inactive splits no longer dim on their own; FocusLost now dims both Normal and NormalNC together, and SignColumn inherits the window background so it dims with the rest.


Assisted-by: Claude Opus 4.7 via Claude Code
change lszkvqukvnpxsrvllzvqtysnyxktqmpu
commit f023c26338961de0601ee49bb5ca8046d9391f59
author Alpha Chen <alpha@kejadlen.dev>
date
parent yuszttrl
diff --git a/.config/nvim/fnl/alphabaster/init.fnl b/.config/nvim/fnl/alphabaster/init.fnl
index 55246507..b273d05f 100644
--- a/.config/nvim/fnl/alphabaster/init.fnl
+++ b/.config/nvim/fnl/alphabaster/init.fnl
@@ -30,7 +30,10 @@
 
   ;;; Base
   (hi :Normal {:fg colors.fg :bg colors.bg})
-  (hi :NormalNC {:fg colors.fg :bg colors.dim-bg})  ;; inactive splits dimmed
+  ;; NormalNC matches Normal so inactive splits don't dim on their own;
+  ;; the FocusLost autocmd in init.fnl dims both together when the whole
+  ;; terminal pane loses focus.
+  (hi :NormalNC {:fg colors.fg :bg colors.bg})
   (hi :NormalFloat {:fg colors.fg :bg colors.black})
   (hi :FloatBorder {:fg colors.bright-black})
 
@@ -79,7 +82,8 @@
   (hi :CursorLine {:bg colors.black})
   (hi :CursorLineNr {:fg semantic.definition :bg colors.black})
   (hi :LineNr {:fg colors.bright-black})
-  (hi :SignColumn {:bg colors.bg})
+  ;; No explicit bg — inherits from Normal/NormalNC so it dims with the window.
+  (hi :SignColumn {})
   (hi :VertSplit {:fg colors.bright-black})
   (hi :WinSeparator {:fg colors.bright-black})
   (hi :StatusLine {:bg colors.black})
diff --git a/.config/nvim/fnl/init.fnl b/.config/nvim/fnl/init.fnl
index 0d39ebb5..09501877 100644
--- a/.config/nvim/fnl/init.fnl
+++ b/.config/nvim/fnl/init.fnl
@@ -219,8 +219,11 @@
 ;; FocusLost/FocusGained fire when the terminal pane loses/gains focus.
 (let [group (nvim-create-augroup :focus-dim {})
       {: colors} (require :alphabaster.palette)
-      dim-bg #(nvim-set-hl 0 :Normal {:fg colors.fg :bg colors.dim-bg})
-      restore-bg #(nvim-set-hl 0 :Normal {:fg colors.fg :bg colors.bg})]
+      set-bg (fn [bg]
+               (nvim-set-hl 0 :Normal {:fg colors.fg : bg})
+               (nvim-set-hl 0 :NormalNC {:fg colors.fg : bg}))
+      dim-bg #(set-bg colors.dim-bg)
+      restore-bg #(set-bg colors.bg)]
   (nvim-create-autocmd :FocusLost {:callback dim-bg : group})
   (nvim-create-autocmd :FocusGained {:callback restore-bg : group}))