Define syntax highlighting

This commit is contained in:
Tommaso Negri
2025-12-05 17:48:26 +01:00
parent b1ea37b455
commit 1c8ecee21a
2 changed files with 116 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
local M = {}
function M.setup(colors, config)
return {
Comment = { fg = colors.yellow.regular, italic = true },
Constant = { fg = colors.purple.regular },
Boolean = { link = "Constant" },
String = { fg = colors.green.regular },
Character = { link = "String" },
Number = { link = "Constant" },
Float = { link = "Number" },
Operator = { fg = colors.dimmed },
Identifier = { link = "Normal" },
Function = { fg = colors.blue.regular },
Statement = { link = "Normal" },
Conditional = { link = "Statement" },
Repeat = { link = "Statement" },
Label = { link = "Statement" },
Keyword = { link = "Statement" },
Exception = { link = "Statement" },
PreProc = { link = "Statement" },
Include = { link = "Statement" },
Define = { link = "Statement" },
Macro = { link = "Statement" },
PreCondit = { link = "Statement" },
Type = { link = "Statement" },
StorageClass = { link = "Statement" },
Structure = { link = "Statement" },
Typedef = { link = "Statement" },
Delimiter = { fg = colors.dimmed },
Special = { fg = colors.dimmed },
SpecialComment = { link = "Special" },
Underlined = { underline = true },
Italic = { italic = true },
}
end
return M

View File

@@ -0,0 +1,73 @@
local M = {}
function M.setup(colors, config)
return {
["@comment"] = { fg = colors.yellow.regular },
["@constant"] = { fg = colors.purple.regular },
["@constant.builtin"] = { link = "@constant" },
["@string"] = { fg = colors.green.regular },
["@string.regex"] = { link = "@string" }, -- TODO: Differentiate regex
["@string.escape"] = { link = "@string" },
["@number"] = { link = "@constant" },
["@boolean"] = { link = "@constant" },
["@operator"] = { fg = colors.dimmed },
["@function"] = { fg = colors.blue.regular },
["@function.call"] = { fg = colors.fg },
["@function.method.call"] = { link = "@function.call" },
["@function.builtin"] = { link = "@function" },
["@function.macro"] = { link = "@function" },
["@method"] = { link = "@function.call" },
["@method.call"] = { link = "@method" },
["@keyword"] = { fg = colors.fg },
["@keyword.function"] = { link = "@keyword" },
["@keyword.operator"] = { link = "@keyword" },
["@keyword.return"] = { link = "@keyword" },
["@punctuation"] = { fg = colors.dimmed },
["@punctuation.delimiter"] = { link = "@punctuation" },
["@punctuation.bracket"] = { link = "@punctuation" },
["@punctuation.special"] = { link = "@punctuation" },
["@variable"] = { fg = colors.fg },
["@variable.builtin"] = { link = "@variable" },
["@variable.parameter"] = { link = "@variable" },
["@variable.member"] = { link = "@variable" },
["@type"] = { fg = colors.fg },
["@type.builtin"] = { link = "@type" },
["@type.definition"] = { link = "@type" },
["@type.qualifier"] = { link = "@type" },
["@tag"] = { fg = colors.yellow.regular },
["@tag.attribute"] = { fg = colors.fg },
["@tag.delimiter"] = { link = "@punctuation" },
["@symbol"] = { fg = colors.blue.regular },
["@string.special"] = { fg = colors.dimmed },
-- ["@attribute"] = { link = "Normal" },
-- ["@constructor"] = { link = "Normal" },
-- ["@conditional"] = { link = "Normal" },
-- ["@error"] = { link = "Normal" }, -- TODO: Add proper error color
-- ["@exception"] = { link = "Normal" },
-- ["@field"] = { link = "Normal" },
-- ["@label"] = { link = "Normal" },
-- ["@module"] = { link = "Normal" },
-- ["@namespace"] = { link = "Normal" },
-- -- ["@none"] = { fg = colors.purple.regular },
-- ["@parameter"] = { link = "Normal" },
-- ["@parameter.reference"] = { link = "Normal" },
-- ["@property"] = { link = "Normal" },
-- ["@repeat"] = { link = "Normal" },
-- ["@symbol"] = { link = "String" },
-- ["@text"] = { link = "Normal" },
-- ["@text.note"] = { fg = colors.blue.regular },
-- ["@text.warning"] = { link = "Normal" }, -- TODO: Add proper error color
}
end
return M