From d034a533e4cf0a3d4577c3024cbb7f10e3a314f2 Mon Sep 17 00:00:00 2001 From: Niverton Date: Sun, 28 Jan 2024 10:24:12 +0100 Subject: [PATCH] Updated treesitter captures https://github.com/nvim-treesitter/nvim-treesitter/issues/2293 --- lua/astrobox/highlights/modules/markup.lua | 68 ++++++++++++++++++++++ lua/astrobox/highlights/modules/syntax.lua | 51 +++++----------- 2 files changed, 82 insertions(+), 37 deletions(-) create mode 100644 lua/astrobox/highlights/modules/markup.lua diff --git a/lua/astrobox/highlights/modules/markup.lua b/lua/astrobox/highlights/modules/markup.lua new file mode 100644 index 0000000..a4198eb --- /dev/null +++ b/lua/astrobox/highlights/modules/markup.lua @@ -0,0 +1,68 @@ +return function(palette) + return { + ["@markup"] = { fg = palette.fg }, + ["@markup.checked"] = { fg = palette.green }, + ["@markup.danger"] = { fg = palette.red }, + ["@markup.diff.add"] = { link = "DiffAdded" }, + ["@markup.diff.delete"] = { link = "DiffDelete" }, + ["@markup.emphasis"] = { fg = palette.fg, italic = true }, + ["@markup.environment"] = { fg = palette.yellow }, + ["@markup.environment.name"] = { fg = palette.orange }, + ["@markup.heading"] = { fg = palette.green, bold = true }, + ["@markup.heading.1.markdown"] = { fg = palette.blue, bold = true }, + ["@markup.heading.2.markdown"] = { fg = palette.aqua, bold = true }, + ["@markup.heading.3.markdown"] = { fg = palette.purple, bold = true }, + ["@markup.heading.4.markdown"] = { fg = palette.yellow, bold = true }, + ["@markup.link"] = { fg = palette.aqua, bold = true }, + ["@markup.link.special"] = { link = "Special" }, + ["@markup.link.url"] = { link = "Underlined" }, + ["@markup.list"] = { link = "Special" }, + ["@markup.math"] = { fg = palette.aqua }, + ["@markup.note"] = { fg = palette.aqua }, + ["@markup.quote"] = { fg = palette.fg, italic = true }, + ["@markup.raw"] = { fg = palette.fg }, + ["@markup.strike"] = { fg = palette.fg, strikethrough = true }, + ["@markup.strong"] = { fg = palette.fg, bold = true }, + ["@markup.todo"] = { link = "Todo" }, + ["@markup.todo.checked"] = { link = "@markup.checked" }, + ["@markup.todo.danger"] = { link = "@markup.danger" }, + ["@markup.todo.note"] = { link = "@markup.note" }, + ["@markup.todo.unchecked"] = { link = "@markup.unchecked" }, + ["@markup.todo.warning"] = { link = "@markup.warning" }, + ["@markup.unchecked"] = { fg = palette.blue }, + ["@markup.underline"] = { link = "Underline" }, + ["@markup.warning"] = { fg = palette.yellow }, + + -- Deprecated + ["@text"] = { fg = palette.fg }, + ["@text.checked"] = { fg = palette.green }, + ["@text.danger"] = { fg = palette.red }, + ["@text.diff.add"] = { link = "DiffAdded" }, + ["@text.diff.delete"] = { link = "DiffDelete" }, + ["@text.emphasis"] = { fg = palette.fg, italic = true }, + ["@text.environment"] = { fg = palette.yellow }, + ["@text.environment.name"] = { fg = palette.orange }, + ["@text.literal"] = { fg = palette.fg }, + ["@text.math"] = { fg = palette.aqua }, + ["@text.note"] = { fg = palette.aqua }, + ["@text.quote"] = { fg = palette.fg, italic = true }, + ["@text.reference"] = { fg = palette.aqua, bold = true }, + ["@text.strike"] = { fg = palette.fg, strikethrough = true }, + ["@text.strong"] = { fg = palette.fg, bold = true }, + ["@text.title"] = { fg = palette.green, bold = true }, + ["@text.title.1.markdown"] = { fg = palette.blue, bold = true }, + ["@text.title.2.markdown"] = { fg = palette.aqua, bold = true }, + ["@text.title.3.markdown"] = { fg = palette.purple, bold = true }, + ["@text.title.4.markdown"] = { fg = palette.yellow, bold = true }, + ["@text.todo"] = { link = "Todo" }, + ["@text.todo.checked"] = { link = "@text.checked" }, + ["@text.todo.danger"] = { link = "@text.danger" }, + ["@text.todo.note"] = { link = "@text.note" }, + ["@text.todo.unchecked"] = { link = "@text.unchecked" }, + ["@text.todo.warning"] = { link = "@text.warning" }, + ["@text.unchecked"] = { fg = palette.blue }, + ["@text.underline"] = { link = "Underline" }, + ["@text.uri"] = { link = "Underlined" }, + ["@text.warning"] = { fg = palette.yellow }, + } +end diff --git a/lua/astrobox/highlights/modules/syntax.lua b/lua/astrobox/highlights/modules/syntax.lua index 075a782..8460c30 100644 --- a/lua/astrobox/highlights/modules/syntax.lua +++ b/lua/astrobox/highlights/modules/syntax.lua @@ -59,6 +59,7 @@ return function(palette) ["@class"] = { link = "Type" }, ["@comment"] = { link = "Comment" }, ["@comment.documentation"] = { fg = palette.gray, bg = palette.none, nocombine = true }, + ["@comment.todo"] = { link = "Todo" }, ["@conditional"] = { link = "Conditional" }, ["@constant"] = { link = "Constant" }, ["@constant.builtin"] = { link = "@constant" }, @@ -72,21 +73,25 @@ return function(palette) ["@error"] = { link = "Error" }, ["@event"] = { fg = palette.orange }, ["@exception"] = { link = "Exception" }, - ["@field"] = { link = "Identifier" }, - ["@float"] = { link = "Float" }, + ["@field"] = { link = "@variable.member" }, -- Deprecated + ["@float"] = { link = "@number.float" }, -- Deprecated ["@function"] = { link = "Function" }, ["@function.macro"] = { link = "Macro" }, + ["@function.method"] = { link = "Function" }, ["@include"] = { link = "Include" }, ["@interface"] = { fg = palette.orange }, ["@keyword"] = { link = "Keyword" }, + ["@keyword.operator"] = { link = "Operator" }, ["@label"] = { link = "Label" }, - ["@method"] = { link = "Function" }, + ["@method"] = { link = "@function.method" }, -- Deprecated ["@modifier"] = { fg = palette.orange }, - ["@namespace"] = { fg = palette.fg_gradiant[2] }, + ["@module"] = { fg = palette.fg_gradiant[2] }, + ["@namespace"] = { link = "@module" }, -- Deprecated ["@none"] = { link = "Conceal" }, ["@number"] = { link = "Number" }, - ["@operator"] = { link = "Operator" }, - ["@parameter"] = { fg = palette.fg_gradiant[2] }, + ["@number.float"] = { link = "Float" }, + ["@operator"] = { link = "@keyword.operator" }, -- Deprecated? + ["@parameter"] = { link = "@variable.parameter" }, -- Deprecated ["@preproc"] = { link = "PreProc" }, ["@property"] = { link = "@field" }, ["@punctuation.bracket"] = { link = "Identifier" }, @@ -99,47 +104,19 @@ return function(palette) ["@string"] = { link = "String" }, ["@string.escape"] = { fg = palette.red }, ["@string.regex"] = { fg = palette.aqua }, - ["@string.special"] = { link = "Special" }, + ["@string.special"] = { link = "Special" }, -- Deprecated? ["@struct"] = { link = "Type" }, ["@symbol"] = { link = "Special" }, ["@tag"] = { fg = palette.red }, ["@tag.attribute"] = { fg = palette.yellow }, ["@tag.delimiter"] = { fg = palette.fg }, - ["@text"] = { fg = palette.fg }, - ["@text.checked"] = { fg = palette.green }, - ["@text.danger"] = { fg = palette.red }, - ["@text.diff.add"] = { link = "DiffAdded" }, - ["@text.diff.delete"] = { link = "DiffDelete" }, - ["@text.emphasis"] = { fg = palette.fg, italic = true }, - ["@text.environment"] = { fg = palette.yellow }, - ["@text.environment.name"] = { fg = palette.orange }, - ["@text.literal"] = { fg = palette.fg }, - ["@text.math"] = { fg = palette.aqua }, - ["@text.note"] = { fg = palette.aqua }, - ["@text.quote"] = { fg = palette.fg, italic = true }, - ["@text.reference"] = { fg = palette.aqua, bold = true }, - ["@text.strike"] = { fg = palette.fg, strikethrough = true }, - ["@text.strong"] = { fg = palette.fg, bold = true }, - ["@text.title"] = { fg = palette.green, bold = true }, - ["@text.title.1.markdown"] = { fg = palette.blue, bold = true }, - ["@text.title.2.markdown"] = { fg = palette.aqua, bold = true }, - ["@text.title.3.markdown"] = { fg = palette.purple, bold = true }, - ["@text.title.4.markdown"] = { fg = palette.yellow, bold = true }, - ["@text.todo"] = { link = "Todo" }, - ["@text.todo.checked"] = { link = "@text.checked" }, - ["@text.todo.danger"] = { link = "@text.danger" }, - ["@text.todo.note"] = { link = "@text.note" }, - ["@text.todo.unchecked"] = { link = "@text.unchecked" }, - ["@text.todo.warning"] = { link = "@text.warning" }, - ["@text.unchecked"] = { fg = palette.blue }, - ["@text.underline"] = { link = "Underline" }, - ["@text.uri"] = { link = "Underlined" }, - ["@text.warning"] = { fg = palette.yellow }, ["@type"] = { link = "Type" }, ["@type.qualifier"] = { fg = palette.purple }, ["@typeParameter"] = { fg = palette.yellow }, ["@variable"] = { link = "Identifier" }, ["@variable.builtin"] = { bold = true }, + ["@variable.member"] = { link = "Identifier" }, + ["@variable.parameter"] = { fg = palette.fg_gradiant[2] }, -- LSP ["@lsp.mod.attribute"] = { link = "@attribute" },