diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-01 17:48:38 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-01 18:55:16 +0200 |
| commit | 2e6c1d550ee1b9a20b430ae3353a11e5616d8716 (patch) | |
| tree | ede26fae1ccae534452bad6e856a838e79391217 /.config/nvim | |
| parent | 0a237d28bdcac24a0783f85b06600663d9773876 (diff) | |
| download | dotfiles-2e6c1d550ee1b9a20b430ae3353a11e5616d8716.tar.gz dotfiles-2e6c1d550ee1b9a20b430ae3353a11e5616d8716.zip | |
misc(nvim): lighter active cursorline highlight
Diffstat (limited to '.config/nvim')
| -rw-r--r-- | .config/nvim/plugin/40-colors.lua | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/.config/nvim/plugin/40-colors.lua b/.config/nvim/plugin/40-colors.lua index ae5f085..32ae452 100644 --- a/.config/nvim/plugin/40-colors.lua +++ b/.config/nvim/plugin/40-colors.lua @@ -64,26 +64,13 @@ local function adjust_highlight() end end --- Theme-aware cursor line, one focus hue (green on dark, magenta/pink on light) --- at two intensities. CursorLineNr stays visible on closed folds (the number --- column is NOT painted by Folded), so it carries the focus cue: active window --- a muted "mix" of the hue, unfocused windows a bright bold badge of the same --- hue. The cursor-line background backs this up: active a subtle neutral "mix" --- tint (light enough to edit on, distinct from Folded), unfocused the muted --- hue wash. +-- Active and inactive cursorline highlight local function set_cursorline_hl() - local active, muted, badge - if vim.o.background == "light" then - active, muted = solarized_colors.mix_blue_light, solarized_colors.mix_magenta_light - badge = { bg = solarized_colors.magenta, fg = solarized_colors.base3, bold = true } - else - active, muted = solarized_colors.mix_base1, solarized_colors.mix_green - badge = { bg = solarized_colors.green, fg = solarized_colors.base03, bold = true } - end - vim.api.nvim_set_hl(ns_active, "CursorLine", { bg = active }) - vim.api.nvim_set_hl(ns_active, "CursorLineNr", { bg = muted }) - vim.api.nvim_set_hl(ns_inactive, "CursorLine", { bg = muted }) - vim.api.nvim_set_hl(ns_inactive, "CursorLineNr", badge) + local accent = vim.o.background == "light" and solarized_colors.mix_blue_light or solarized_colors.mix_base1 + vim.api.nvim_set_hl(ns_active, "CursorLine", { bg = accent }) + vim.api.nvim_set_hl(ns_active, "CursorLineNr", { bg = accent }) + vim.api.nvim_set_hl(ns_inactive, "CursorLine", { bg = accent, underline = true }) + vim.api.nvim_set_hl(ns_inactive, "CursorLineNr", { bg = accent, underline = true }) end local function apply_highlights() |
