feat: add treesitter highlights as default

This commit is contained in:
2023-01-28 15:39:21 -03:00
parent 9e940a1193
commit 32be5242f6

View File

@@ -13,6 +13,12 @@ local function load_highlights(highlights)
end end
end end
local function make_default(table)
for _, v in pairs(table) do
v.default = true
end
end
hl.predef = { hl.predef = {
Fg = { fg = p.fg }, Fg = { fg = p.fg },
Grey = { fg = p.grey }, Grey = { fg = p.grey },
@@ -202,77 +208,82 @@ hl.plugins.treesitter = {
if u.check_min_version(0, 8, 0) then if u.check_min_version(0, 8, 0) then
hl.plugins.treesitter = { hl.plugins.treesitter = {
["@comment"] = { link = "Comment" }, ["@annotation"] = { link = "PreProc" },
["@error"] = { link = "Error" }, ["@attribute"] = { link = "PreProc" },
["@none"] = { bg = "NONE", fg = "NONE" }, ["@boolean"] = { link = "Boolean" },
["@preproc"] = { link = "PreProc" },
["@define"] = { link = "Define" },
["@operator"] = { link = "Operator" },
["@punctuation.delimiter"] = { link = "Delimiter" },
["@punctuation.bracket"] = { link = "Delimiter" },
["@punctuation.special"] = { link = "Delimiter" },
["@string"] = { link = "String" },
["@string.regex"] = { link = "String" },
["@string.escape"] = { link = "SpecialChar" },
["@string.special"] = { link = "SpecialChar" },
["@character"] = { link = "Character" }, ["@character"] = { link = "Character" },
["@character.special"] = { link = "SpecialChar" }, ["@character.special"] = { link = "SpecialChar" },
["@boolean"] = { link = "Boolean" }, ["@comment"] = { link = "Comment" },
["@number"] = { link = "Number" },
["@float"] = { link = "Float" },
["@function"] = { link = "Function" },
["@function.call"] = { link = "Function" },
["@function.builtin"] = { link = "Special" },
["@function.macro"] = { link = "Macro" },
["@method"] = { link = "Function" },
["@method.call"] = { link = "Function" },
["@constructor"] = { link = "Special" },
["@parameter"] = { link = "Identifier" },
["@keyword"] = { link = "Keyword" },
["@keyword.function"] = { link = "Keyword" },
["@keyword.operator"] = { link = "Keyword" },
["@keyword.return"] = { link = "Keyword" },
["@conditional"] = { link = "Conditional" }, ["@conditional"] = { link = "Conditional" },
["@repeat"] = { link = "Repeat" },
["@debug"] = { link = "Debug" },
["@label"] = { link = "Label" },
["@include"] = { link = "Include" },
["@exception"] = { link = "Exception" },
["@type"] = { link = "Type" },
["@type.builtin"] = { link = "Type" },
["@type.qualifier"] = { link = "Type" },
["@type.definition"] = { link = "Typedef" },
["@storageclass"] = { link = "StorageClass" },
["@attribute"] = { link = "PreProc" },
["@field"] = { link = "Identifier" },
["@property"] = { link = "Function" },
["@variable"] = { link = "Normal" },
["@variable.builtin"] = { link = "Special" },
["@constant"] = { link = "Constant" }, ["@constant"] = { link = "Constant" },
["@constant.builtin"] = { link = "Special" }, ["@constant.builtin"] = { link = "Special" },
["@constant.macro"] = { link = "Define" }, ["@constant.macro"] = { link = "Define" },
["@constructor"] = { link = "Special" },
["@debug"] = { link = "Debug" },
["@define"] = { link = "Define" },
["@defaultLibrary"] = { link = "Special" },
["@error"] = { link = "Error" },
["@exception"] = { link = "Exception" },
["@field"] = { link = "Identifier" },
["@float"] = { link = "Float" },
["@function"] = { link = "Function" },
["@function.builtin"] = { link = "Special" },
["@function.call"] = { link = "@function" },
["@function.macro"] = { link = "Macro" },
["@include"] = { link = "Include" },
["@keyword"] = { link = "Keyword" },
["@keyword.function"] = { link = "Keyword" },
["@keyword.operator"] = { link = "@operator" },
["@keyword.return"] = { link = "@keyword" },
["@label"] = { link = "Label" },
["@method"] = { link = "Function" },
["@method.call"] = { link = "@method" },
["@namespace"] = { link = "Include" }, ["@namespace"] = { link = "Include" },
["@none"] = { bg = "NONE", fg = "NONE" },
["@number"] = { link = "Number" },
["@operator"] = { link = "Operator" },
["@parameter"] = { link = "Identifier" },
["@parameter.reference"] = { link = "@parameter" },
["@preproc"] = { link = "PreProc" },
["@property"] = { link = "Identifier" },
["@punctuation.bracket"] = { link = "Delimiter" },
["@punctuation.delimiter"] = { link = "Delimiter" },
["@punctuation.special"] = { link = "Delimiter" },
["@repeat"] = { link = "Repeat" },
["@storageclass"] = { link = "StorageClass" },
["@string"] = { link = "String" },
["@string.escape"] = { link = "SpecialChar" },
["@string.regex"] = { link = "String" },
["@string.special"] = { link = "SpecialChar" },
["@symbol"] = { link = "Identifier" }, ["@symbol"] = { link = "Identifier" },
["@text"] = { link = "Normal" }, ["@tag"] = { link = "Label" },
["@text.strong"] = { bold = true }, ["@tag.attribute"] = { link = "@property" },
["@tag.delimiter"] = { link = "Delimiter" },
["@text"] = { link = "@none" },
["@text.danger"] = { link = "WarningMsg" },
["@text.emphasis"] = { italic = true }, ["@text.emphasis"] = { italic = true },
["@text.underline"] = { underline = true },
["@text.strike"] = { strikethrough = true },
["@text.title"] = { link = "Title" },
["@text.literal"] = { link = "String" },
["@text.uri"] = { link = "Underlined" },
["@text.math"] = { link = "Special" },
["@text.environment"] = { link = "Macro" }, ["@text.environment"] = { link = "Macro" },
["@text.environment.name"] = { link = "Type" }, ["@text.environment.name"] = { link = "Type" },
["@text.literal"] = { link = "String" },
["@text.math"] = { link = "Special" },
["@text.note"] = { link = "SpecialComment" },
["@text.reference"] = { link = "Constant" }, ["@text.reference"] = { link = "Constant" },
["@text.strike"] = { strikethrough = true },
["@text.strong"] = { bold = true },
["@text.title"] = { link = "Title" },
["@text.todo"] = { link = "Todo" }, ["@text.todo"] = { link = "Todo" },
["@text.note"] = hl.predef.BlueItalic, ["@text.underline"] = { underline = true },
["@text.warning"] = hl.predef.YellowItalic, ["@text.uri"] = { link = "Underlined" },
["@text.danger"] = hl.predef.RedItalic, ["@text.warning"] = { link = "Todo" },
["@tag"] = { link = "Tag" }, ["@todo"] = { link = "Todo" },
["@tag.attribute"] = { link = "Identifier" }, ["@type"] = { link = "Type" },
["@tag.delimiter"] = { link = "Delimiter" }, ["@type.builtin"] = { link = "Type" },
["@type.definition"] = { link = "Typedef" },
["@type.qualifier"] = { link = "Type" },
["@variable"] = { link = "Normal" },
["@variable.builtin"] = { link = "Special" },
} }
make_default(hl.plugins.treesitter)
hl.plugins.lsp_semantic_tokens = { hl.plugins.lsp_semantic_tokens = {
LspNamespace = { link = "@namespace" }, LspNamespace = { link = "@namespace" },