---setup highlight groups
---@param configs DefaultConfig
----@return table<string, Highlight | string>
+---@return table<string, Highlight>
---@nodiscard
local function setup(configs)
local colors = configs.colors
BufferInactiveTarget = { fg = colors.red, },
-- Compe
- CompeDocumentation = "Pmenu",
- CompeDocumentationBorder = "Pmenu",
+ CompeDocumentation = { link = "Pmenu" },
+ CompeDocumentationBorder = { link = "Pmenu" },
-- Cmp
- CmpItemKind = "Pmenu",
- CmpItemAbbr = "Pmenu",
- CmpItemKindMethod = "TSMethod",
- CmpItemKindText = "TSText",
- CmpItemKindFunction = "TSFunction",
- CmpItemKindConstructor = "TSType",
- CmpItemKindVariable = "TSVariable",
- CmpItemKindClass = "TSType",
- CmpItemKindInterface = "TSType",
- CmpItemKindModule = "TSNamespace",
- CmpItemKindProperty = "TSProperty",
- CmpItemKindOperator = "TSOperator",
- CmpItemKindReference = "TSParameterReference",
- CmpItemKindUnit = "TSField",
- CmpItemKindValue = "TSField",
- CmpItemKindField = "TSField",
- CmpItemKindEnum = "TSField",
- CmpItemKindKeyword = "TSKeyword",
- CmpItemKindSnippet = "TSText",
- CmpItemKindColor = "cssColor",
- CmpItemKindFile = "TSURI",
- CmpItemKindFolder = "TSURI",
- CmpItemKindEvent = "TSConstant",
- CmpItemKindEnumMember = "TSField",
- CmpItemKindConstant = "TSConstant",
- CmpItemKindStruct = "TSStructure",
- CmpItemKindTypeParameter = "TSParameter",
+ CmpItemKind = { link = "Pmenu" },
+ CmpItemAbbr = { link = "Pmenu" },
+ CmpItemKindMethod = { link = "TSMethod" },
+ CmpItemKindText = { link = "TSText" },
+ CmpItemKindFunction = { link = "TSFunction" },
+ CmpItemKindConstructor = { link = "TSType" },
+ CmpItemKindVariable = { link = "TSVariable" },
+ CmpItemKindClass = { link = "TSType" },
+ CmpItemKindInterface = { link = "TSType" },
+ CmpItemKindModule = { link = "TSNamespace" },
+ CmpItemKindProperty = { link = "TSProperty" },
+ CmpItemKindOperator = { link = "TSOperator" },
+ CmpItemKindReference = { link = "TSParameterReference" },
+ CmpItemKindUnit = { link = "TSField" },
+ CmpItemKindValue = { link = "TSField" },
+ CmpItemKindField = { link = "TSField" },
+ CmpItemKindEnum = { link = "TSField" },
+ CmpItemKindKeyword = { link = "TSKeyword" },
+ CmpItemKindSnippet = { link = "TSText" },
+ CmpItemKindColor = { link = "cssColor" },
+ CmpItemKindFile = { link = "TSURI" },
+ CmpItemKindFolder = { link = "TSURI" },
+ CmpItemKindEvent = { link = "TSConstant" },
+ CmpItemKindEnumMember = { link = "TSField" },
+ CmpItemKindConstant = { link = "TSConstant" },
+ CmpItemKindStruct = { link = "TSStructure" },
+ CmpItemKindTypeParameter = { link = "TSParameter" },
-- TS rainbow colors
rainbowcol1 = { fg = colors.red, },
---@field show_end_of_buffer boolean
---@field lualine_bg_color string?
---@field colors Palette
----@field overrides table<string, Highlight|string>
+---@field overrides table<string, Highlight>
local DEFAULT_CONFIG = {
italic_comment = false,
transparent_bg = false,
groups[group] = setting
end
- -- run defined highlights
- for group, value in pairs(groups) do
- if type(value) == "table" then
- ---@cast value Highlight
- nvim_set_hl(0, group, value)
- elseif type(value) == "string" then
- nvim_set_hl(0, group, { link = value })
- end
+ -- set defined highlights
+ for group, setting in pairs(groups) do
+ nvim_set_hl(0, group, setting)
end
end