summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-05-19 18:21:33 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-05-19 18:21:33 +0200
commit4ca093d7669fca2c59184e32b60a96bfac0090e6 (patch)
tree5c1f323e5d4e2852aecf0962bdb7c5567f13b2ed
parent2c5a0a531d8b6bfd4826ec009a0231362d9594ae (diff)
downloaddotfiles-4ca093d7669fca2c59184e32b60a96bfac0090e6.tar.gz
dotfiles-4ca093d7669fca2c59184e32b60a96bfac0090e6.zip
misc(nvim): embolden statusline diff/diagnostics, tidy lualine setup
Stamp bold onto lualine's generated lualine_b_diff*/diagnostics* highlight groups with nvim_set_hl update=true so only the bold bit changes (fg and section b background preserved), re-applied after each lualine (re)build: initial setup, theme switch, ColorScheme. Also carry the component/section separators into the background OptionSet handler so they survive the light/dark theme swap.
-rw-r--r--.config/nvim/plugin/50-statusline.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/.config/nvim/plugin/50-statusline.lua b/.config/nvim/plugin/50-statusline.lua
index e32800e..10c88f6 100644
--- a/.config/nvim/plugin/50-statusline.lua
+++ b/.config/nvim/plugin/50-statusline.lua
@@ -23,6 +23,27 @@ local function statuses()
return (vim.b.autoformat and "+F" or "") .. (vim.o.spell and spell_status() or "")
end
+-- lualine builds its own section-b-backed highlights for the diff/diagnostics
+-- components (lualine_b_diff_added_normal, lualine_b_diagnostics_error_normal,
+-- ...). Stamp bold onto them with update=true so only the bold attribute
+-- changes -- fg and section b's background are left untouched. Must run after
+-- lualine (re)creates the groups: initial setup, theme switch, colorscheme.
+local function bold_diff_diag()
+ for name in pairs(vim.api.nvim_get_hl(0, {})) do
+ if name:find("^lualine_b_diff") or name:find("^lualine_b_diagnostics") then
+ vim.api.nvim_set_hl(0, name, { bold = true, update = true })
+ end
+ end
+end
+
+vim.api.nvim_create_autocmd("ColorScheme", {
+ desc = "Re-bold lualine diff/diagnostics after colorscheme rebuild",
+ group = vim.g.dotfiles.augroup,
+ callback = function()
+ vim.schedule(bold_diff_diag)
+ end,
+})
+
local lualine_sections = {
lualine_c = { statuses, "filename" },
lualine_x = { "encoding", "fileformat", "filetype", "lsp_status" },
@@ -38,8 +59,11 @@ vim.api.nvim_create_autocmd("OptionSet", {
options = {
theme = vim.o.background == "light" and "solarized_light" or "solarized_dark",
disabled_filetypes = { "netrw", "qf" },
+ component_separators = { left = "|", right = "|" },
+ section_separators = { left = "", right = "" },
},
})
+ vim.schedule(bold_diff_diag)
end,
})
@@ -47,6 +71,7 @@ lualine.setup({
options = { theme = vim.o.background == "light" and "solarized_light" or "solarized_dark" },
sections = lualine_sections,
})
+vim.schedule(bold_diff_diag)
vim.api.nvim_create_user_command("LualineConfig", function()
vim.notify(vim.inspect(lualine.get_config()))