diff options
Diffstat (limited to 'lua/prismite/groups/plugins/treesitter.lua')
-rw-r--r-- | lua/prismite/groups/plugins/treesitter.lua | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/lua/prismite/groups/plugins/treesitter.lua b/lua/prismite/groups/plugins/treesitter.lua new file mode 100644 index 0000000..0302c53 --- /dev/null +++ b/lua/prismite/groups/plugins/treesitter.lua @@ -0,0 +1,164 @@ +local colors = require "prismite.palette" + +return { + -- various variable names + ["@variable"] = { link = "Identifier" }, + -- built-in variable names (e.g. `this`) + ["@variable.builtin"] = { fg = colors.pink, bold = true }, + -- parameters of a function + ["@variable.parameter"] = { link = "@variable" }, + -- special parameters (e.g. `_`, `it`) + ["@variable.parameter.builtin"] = { link = "@variable.builtin" }, + -- object and struct fields + ["@variable.member"] = { fg = colors.fg }, + + -- constant identifiers + ["@constant"] = { link = "Constant" }, + -- built-in constant values + ["@constant.builtin"] = { link = "@constant" }, + -- constants defined by the preprocessor + ["@constant.macro"] = { link = "@constant" }, + + -- modules or namespaces + ["@module"] = { italic = true }, + -- built-in modules or namespaces + ["@module.builtin"] = { link = "@module" }, + -- GOTO and other labels (e.g. `label:` in C), including heredoc labels + ["@label"] = { link = "Todo" }, + + -- string literals + ["@string"] = { link = "String" }, + -- string documenting code (e.g. Python docstrings + ["@string.documentation"] = { link = "@comment" }, + -- regular expressions + ["@string.regexp"] = { link = "@constant" }, + -- escape sequences + ["@string.escape"] = { fg = colors.cyan }, + -- other special strings (e.g. dates) + ["@string.special"] = { link = "@string" }, + -- symbols or atoms + ["@string.special.symbol"] = { link = "@string" }, + -- URIs (e.g. hyperlinks) + ["@string.special.url"] = { underline = true }, + -- filenames + ["@string.special.path"] = { link = "@string" }, + + -- character literals + ["@character"] = { link = "@constant" }, + -- special characters (e.g. wildcards) + ["@character.special"] = { link = "String" }, + + -- boolean literals + ["@boolean"] = { link = "@constant" }, + -- numeric literals + ["@number"] = { link = "@constant" }, + -- floating-point number literals + ["@number.float"] = { link = "@number" }, + + -- type or class definitions and annotations + ["@type"] = { link = "Type" }, + -- built-in types + ["@type.builtin"] = { link = "@type" }, + -- identifiers in type definitions (e.g. `typedef <type> <identifier>` in C) + ["@type.definition"] = { link = "@type" }, + + -- attribute annotations (e.g. Python decorators, Rust lifetimes) + ["@attribute"] = { link = "Function" }, + -- builtin annotations (e.g. `@property` in Python) + ["@attribute.builtin"] = { link = "@attribute" }, + -- the key in key/value pairs + ["@property"] = { fg = colors.fg }, + + -- function definitions + ["@function"] = { link = "Function" }, + -- built-in functions + ["@function.builtin"] = { link = "@function" }, + -- function calls + ["@function.call"] = { link = "@function" }, + -- preprocessor macros + ["@function.macro"] = { link = "@constant.macro" }, + + -- method definitions + ["@function.method"] = { link = "@function" }, + -- method calls + ["@function.method.call"] = { link = "@function.method" }, + + -- constructor calls and definitions + ["@constructor"] = { link = "@function" }, + -- this is overriden because for some reason the {} in table inits + -- are parsed as constructors, which ig makes sense + ["@constructor.lua"] = { fg = colors.fg }, + -- symbolic operators (e.g. `+` / `*`) + ["@operator"] = { fg = colors.fg }, + + -- keywords not fitting into specific categories + ["@keyword"] = { link = "Keyword" }, + -- keywords related to coroutines (e.g. `go` in Go, `async/await` in Python) + ["@keyword.coroutine"] = { link = "@keyword" }, + -- keywords that define a function (e.g. `func` in Go, `def` in Python) + ["@keyword.function"] = { link = "@keyword" }, + -- operators that are English words (e.g. `and` / `or`) + ["@keyword.operator"] = { link = "@keyword" }, + -- keywords for including or exporting modules (e.g. `import` / `from` in Python) + ["@keyword.import"] = { link = "@keyword" }, + -- keywords describing namespaces and composite types (e.g. `struct`, `enum`) + ["@keyword.type"] = { link = "@keyword" }, + -- keywords modifying other constructs (e.g. `const`, `static`, `public`) + ["@keyword.modifier"] = { link = "@keyword" }, + -- keywords related to loops (e.g. `for` / `while`) + ["@keyword.repeat"] = { link = "@keyword" }, + -- keywords like `return` and `yield` + ["@keyword.return"] = { link = "@keyword" }, + -- keywords related to debugging + ["@keyword.debug"] = { link = "@keyword" }, + -- keywords related to exceptions (e.g. `throw` / `catch`) + ["@keyword.exception"] = { link = "@keyword" }, + + -- keywords related to conditionals (e.g. `if` / `else`) + ["@keyword.conditional"] = { link = "@keyword" }, + -- ternary operator (e.g. `?` / `:`) + ["@keyword.conditional.ternary"] = { link = "@operator" }, + + -- various preprocessor directives & shebangs + ["@keyword.directive"] = { link = "@keyword" }, + -- preprocessor definition directives + ["@keyword.directive.define"] = { link = "@keyword" }, + + -- delimiters (e.g. `;` / `.` / `,`) + ["@punctuation"] = { fg = colors.fg }, + -- brackets (e.g. `()` / `{}` / `[]`) + ["@punctuation.special"] = { fg = colors.cyan }, + -- special symbols (e.g. `{}` in string interpolation) + + -- line and block comments + ["@comment"] = { link = "Comment" }, + -- comments documenting code + ["@comment.documentation"] = { link = "@comment" }, + + ["@comment.error"] = { sp = colors.red, underline = true }, + ["@comment.warning"] = { sp = colors.orange, underline = true }, + ["@comment.todo"] = { link = "Todo" }, + ["@comment.note"] = { sp = colors.blue, underline = true }, + + ["@markup.strong"] = { bold = true }, + ["@markup.italic"] = { italic = true }, + ["@markup.strikethrough"] = { strikethrough = true }, + ["@markup.underline"] = { underline = true }, + + ["@markup.heading"] = { fg = colors.blue }, + + ["@markup.link"] = { fg = colors.cyan }, + ["@markup.link.label"] = { bold = true }, + ["@markup.link.url"] = { underline = true }, + + ["@diff.plus"] = { link = "Added" }, + ["@diff.delta"] = { link = "Changed" }, + ["@diff.minus"] = { link = "Removed" }, + + ["@tag"] = { link = "htmlTag" }, + ["@tag.builtin"] = { link = "@tag" }, + ["@tag.attribute"] = { link = "@property" }, + ["@tag.delimeter"] = { link = "@tag" }, + + ["@none"] = { link = "Normal" }, +} |