From 4d7c0e69a8483e9647e7218479a31ed59dfd189a Mon Sep 17 00:00:00 2001 From: m0n99 Date: Sat, 10 Jan 2026 04:29:06 +0700 Subject: [PATCH 1/4] feat: sync highlight mapping and add LSP --- lua/bearded/highlights.lua | 40 ++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/lua/bearded/highlights.lua b/lua/bearded/highlights.lua index 1f3e1d4..e24ad59 100644 --- a/lua/bearded/highlights.lua +++ b/lua/bearded/highlights.lua @@ -45,7 +45,7 @@ local function syntax_groups(colors, opts) String = { fg = colors.green }, Character = { fg = colors.green }, Number = { fg = colors.orange }, - Boolean = { fg = colors.orange }, + Boolean = { fg = colors.red }, Float = { fg = colors.orange }, Identifier = { fg = colors.fg }, Function = { fg = colors.blue }, @@ -64,35 +64,42 @@ local function syntax_groups(colors, opts) StorageClass = { fg = colors.purple }, Structure = { fg = colors.purple }, Typedef = { fg = colors.purple }, - Special = { fg = colors.pink }, + Special = { fg = colors.teal }, Delimiter = { fg = colors.dim }, SpecialComment = { fg = colors.dim, italic = italic }, Debug = { fg = colors.red }, ["@comment"] = { fg = colors.dim, italic = italic }, - ["@variable"] = { fg = colors.fg }, - ["@variable.member"] = { fg = colors.fg }, + ["@variable"] = { fg = colors.salmon }, + ["@variable.member"] = { fg = colors.orange }, ["@variable.parameter"] = { fg = colors.pink }, ["@variable.builtin"] = { fg = colors.orange, italic = italic }, ["@field"] = { fg = colors.pink }, - ["@property"] = { fg = colors.orange }, + ["@property"] = { fg = colors.salmon }, ["@parameter"] = { fg = colors.pink }, ["@constant"] = { fg = colors.orange }, ["@constant.builtin"] = { fg = colors.orange }, ["@number"] = { fg = colors.orange }, - ["@boolean"] = { fg = colors.orange }, + ["@boolean"] = { fg = colors.red }, ["@string"] = { fg = colors.green }, - ["@string.escape"] = { fg = colors.orange }, - ["@string.special"] = { fg = colors.teal }, + ["@string.escape"] = { fg = colors.red }, + ["@string.special"] = { fg = colors.red }, + ["@string.regexp"] = { fg = colors.red }, ["@character"] = { fg = colors.green }, + ["@character.special"] = { fg = colors.teal }, ["@constructor"] = { fg = colors.purple }, ["@type"] = { fg = colors.purple }, ["@type.builtin"] = { fg = colors.purple }, ["@type.definition"] = { fg = colors.purple }, - ["@keyword"] = { fg = colors.yellow, italic = italic }, - ["@keyword.function"] = { fg = colors.yellow, italic = italic }, + ["@keyword"] = { fg = colors.teal, italic = italic }, + ["@keyword.function"] = { fg = colors.teal, italic = italic }, ["@keyword.return"] = { fg = colors.yellow, italic = italic }, ["@keyword.operator"] = { fg = colors.yellow }, ["@keyword.import"] = { fg = colors.yellow, italic = italic }, + ["@keyword.modifier"] = { fg = colors.yellow, italic = italic }, + ["@keyword.conditional"] = { fg = colors.yellow, italic = italic }, + ["@keyword.repeat"] = { fg = colors.yellow, italic = italic }, + ["@keyword.coroutine"] = { fg = colors.yellow, italic = italic }, + ["@keyword.type"] = { fg = colors.teal, italic = italic }, ["@function"] = { fg = colors.blue }, ["@function.builtin"] = { fg = colors.blue }, ["@function.call"] = { fg = colors.blue }, @@ -113,6 +120,19 @@ local function syntax_groups(colors, opts) ["@markup.link"] = { fg = colors.blue, underline = true }, ["@markup.list"] = { fg = colors.blue }, ["@markup.raw"] = { fg = colors.purple }, + + -- LSP semantic tokens + ["@lsp.type.class"] = { fg = colors.purple }, + ["@lsp.typemod.class.declaration"] = { fg = colors.purple }, + ["@lsp.typemod.class.decorator"] = { fg = colors.pink }, + ["@lsp.type.enumMember"] = { fg = colors.purple }, + ["@lsp.type.decorator"] = { fg = colors.pink }, + ["@lsp.type.namespace"] = { fg = colors.blue }, + ["@lsp.type.parameter"] = { fg = colors.pink }, + ["@lsp.type.property"] = { fg = colors.orange }, + ["@lsp.typemod.property.declaration"] = { fg = colors.fg }, + ["@lsp.type.variable"] = { fg = colors.salmon }, + ["@lsp.typemod.variable.defaultLibrary"] = { fg = colors.teal }, } end From 345e3a02cd3171067bf2460602a752878e03f114 Mon Sep 17 00:00:00 2001 From: m0n99 Date: Sat, 10 Jan 2026 15:44:11 +0700 Subject: [PATCH 2/4] feat: blend cursor line and Blink indent --- lua/bearded/highlights.lua | 41 +++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/lua/bearded/highlights.lua b/lua/bearded/highlights.lua index e24ad59..9e88b5a 100644 --- a/lua/bearded/highlights.lua +++ b/lua/bearded/highlights.lua @@ -14,6 +14,34 @@ local function normalize_color(color) return color end +local function blend_hex(foreground, background, alpha) + if type(foreground) ~= "string" or type(background) ~= "string" then + return foreground + end + if foreground == "NONE" or background == "NONE" then + return foreground + end + if not foreground:match "^#%x%x%x%x%x%x$" or not background:match "^#%x%x%x%x%x%x$" then + return foreground + end + + local fr = tonumber(foreground:sub(2, 3), 16) + local fg = tonumber(foreground:sub(4, 5), 16) + local fb = tonumber(foreground:sub(6, 7), 16) + local br = tonumber(background:sub(2, 3), 16) + local bg = tonumber(background:sub(4, 5), 16) + local bb = tonumber(background:sub(6, 7), 16) + + local function mix(fg_c, bg_c) + return math.floor((alpha * fg_c) + ((1 - alpha) * bg_c) + 0.5) + end + + local r = mix(fr, br) + local g = mix(fg, bg) + local b = mix(fb, bb) + return string.format("#%02x%02x%02x", r, g, b) +end + local function set(name, values) if values.fg then values.fg = normalize_color(values.fg) @@ -164,7 +192,6 @@ local function ui_groups(ui, colors, levels, opts) local accent = colors.purple or colors.blue or primary local italic = opts.italic ~= false local bold = opts.bold ~= false - local groups = { Normal = { fg = fg, bg = bg }, NormalNC = { fg = fg, bg = bg }, @@ -172,10 +199,10 @@ local function ui_groups(ui, colors, levels, opts) FloatBorder = { fg = dim, bg = bg_alt }, FloatTitle = { fg = primary, bg = bg_alt, bold = bold }, Comment = { fg = dim, italic = italic }, - CursorLine = { bg = bg_mid }, - CursorColumn = { bg = bg_mid }, - CursorLineNr = { fg = primary, bg = bg_mid, bold = bold }, - LineNr = { fg = dim, bg = bg_mid }, + CursorLine = { bg = bg == "NONE" and bg_mid or blend_hex(primary, bg, 0.06) }, + CursorColumn = { bg = bg == "NONE" and bg_mid or blend_hex(primary, bg, 0.06) }, + CursorLineNr = { fg = bg == "NONE" and primary or blend_hex(fg, bg_mid, 0.6), bg = bg_mid, bold = bold }, + LineNr = { fg = bg == "NONE" and dim or blend_hex(fg, bg, 0.25), bg = bg_mid }, Visual = { bg = ui.primaryalt or "#444444" }, Search = { fg = bg, bg = levels.warning or colors.orange }, IncSearch = { fg = bg, bg = levels.info or colors.blue, bold = bold }, @@ -276,6 +303,10 @@ local function plugin_groups(colors, ui, levels) CmpItemKindClass = { fg = colors.purple }, CmpItemKindInterface = { fg = colors.purple }, CmpItemKindModule = { fg = colors.teal }, + + -- Blink Indent + BlinkIndent = { fg = blend_hex(ui.defaultalt or ui.default or colors.blue or "#666666", ui.uibackground, 0.2) }, + BlinkIndentScope = { fg = blend_hex(ui.defaultalt or ui.default or colors.blue or "#666666", ui.uibackground, 0.8) }, } merge(g, neo_tree) From c7f9dd2850034edee7dc51fc3bbd22e9037e9ca0 Mon Sep 17 00:00:00 2001 From: m0n99 Date: Mon, 12 Jan 2026 15:55:51 +0700 Subject: [PATCH 3/4] feat: add DiagnosticUnnecessary blend --- lua/bearded/highlights.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/bearded/highlights.lua b/lua/bearded/highlights.lua index 9e88b5a..c6f4361 100644 --- a/lua/bearded/highlights.lua +++ b/lua/bearded/highlights.lua @@ -170,6 +170,10 @@ local function diagnostics(levels, colors, ui) DiagnosticWarn = { fg = levels.warning or colors.orange }, DiagnosticInfo = { fg = levels.info or colors.blue }, DiagnosticHint = { fg = colors.purple or colors.teal }, + DiagnosticUnnecessary = { + fg = ui.uibackground == "NONE" and (ui.defaultalt or "#5a5a5a") + or blend_hex(ui.default or "#ffffff", ui.uibackground, 0.67), + }, DiagnosticUnderlineError = underline(levels.danger or colors.red), DiagnosticUnderlineWarn = underline(levels.warning or colors.orange), DiagnosticUnderlineInfo = underline(levels.info or colors.blue), @@ -203,7 +207,7 @@ local function ui_groups(ui, colors, levels, opts) CursorColumn = { bg = bg == "NONE" and bg_mid or blend_hex(primary, bg, 0.06) }, CursorLineNr = { fg = bg == "NONE" and primary or blend_hex(fg, bg_mid, 0.6), bg = bg_mid, bold = bold }, LineNr = { fg = bg == "NONE" and dim or blend_hex(fg, bg, 0.25), bg = bg_mid }, - Visual = { bg = ui.primaryalt or "#444444" }, + Visual = { bg = bg == "NONE" and (ui.primaryalt or "#444444") or blend_hex(primary, bg, 0.3) }, Search = { fg = bg, bg = levels.warning or colors.orange }, IncSearch = { fg = bg, bg = levels.info or colors.blue, bold = bold }, MatchParen = { fg = accent, bold = bold }, From 7ebd2c78b74c3abd3d0dad7ce4a7483c1d8a6e54 Mon Sep 17 00:00:00 2001 From: m0n99 Date: Fri, 16 Jan 2026 18:57:08 +0700 Subject: [PATCH 4/4] fix: stylua lint --- lua/bearded/highlights.lua | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lua/bearded/highlights.lua b/lua/bearded/highlights.lua index c6f4361..d3bdf88 100644 --- a/lua/bearded/highlights.lua +++ b/lua/bearded/highlights.lua @@ -205,7 +205,11 @@ local function ui_groups(ui, colors, levels, opts) Comment = { fg = dim, italic = italic }, CursorLine = { bg = bg == "NONE" and bg_mid or blend_hex(primary, bg, 0.06) }, CursorColumn = { bg = bg == "NONE" and bg_mid or blend_hex(primary, bg, 0.06) }, - CursorLineNr = { fg = bg == "NONE" and primary or blend_hex(fg, bg_mid, 0.6), bg = bg_mid, bold = bold }, + CursorLineNr = { + fg = bg == "NONE" and primary or blend_hex(fg, bg_mid, 0.6), + bg = bg_mid, + bold = bold, + }, LineNr = { fg = bg == "NONE" and dim or blend_hex(fg, bg, 0.25), bg = bg_mid }, Visual = { bg = bg == "NONE" and (ui.primaryalt or "#444444") or blend_hex(primary, bg, 0.3) }, Search = { fg = bg, bg = levels.warning or colors.orange }, @@ -309,8 +313,12 @@ local function plugin_groups(colors, ui, levels) CmpItemKindModule = { fg = colors.teal }, -- Blink Indent - BlinkIndent = { fg = blend_hex(ui.defaultalt or ui.default or colors.blue or "#666666", ui.uibackground, 0.2) }, - BlinkIndentScope = { fg = blend_hex(ui.defaultalt or ui.default or colors.blue or "#666666", ui.uibackground, 0.8) }, + BlinkIndent = { + fg = blend_hex(ui.defaultalt or ui.default or colors.blue or "#666666", ui.uibackground, 0.2), + }, + BlinkIndentScope = { + fg = blend_hex(ui.defaultalt or ui.default or colors.blue or "#666666", ui.uibackground, 0.8), + }, } merge(g, neo_tree)