this repo has no description

Split out treesitter groups.

+133 -127
+130
lua/wombat_lua/groups/treesitter.lua
··· 1 + local M = {} 2 + 3 + function M.build(Group, c, g, s) 4 + Group.new("UnknownThing", c.norm, c.unknown) 5 + 6 + -- Structured following: 7 + -- https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights 8 + 9 + -- Misc {{{1 10 + -- @errors is TS errors. Wildly noisy if you enable it. 11 + -- Group.link("@error", g.ErrorMsg) -- syntax/parser errors 12 + Group.link("@comment", g.Comment) -- line and block comments 13 + -- Group.link("@none", g.UnknownThing) -- completely disable the highlight 14 + -- Group.link("@preproc", g.UnknownThing) -- various preprocessor directives & shebangs 15 + -- Group.link("@define", g.UnknownThing) -- preprocessor definition directives 16 + Group.link("@operator", g.Operator) -- symbolic operators (e.g. `+` / `*`) 17 + 18 + -- Punctuation {{{1 19 + Group.link("@punctuation.delimiter", g.Special) -- delimiters (e.g. `;` / `.` / `,`) 20 + Group.link("@punctuation.bracket", g.Special) -- brackets (e.g. `()` / `{}` / `[]`) 21 + Group.link("@punctuation.special", g.Special) -- special symbols (e.g. `{}` in string interpolation) 22 + 23 + -- Literals {{{1 24 + Group.link("@string", g.String) -- string literals 25 + Group.link("@string.regex", g.String) -- regular expressions 26 + Group.link("@string.escape", g.StringEscape) -- escape sequences 27 + Group.link("@string.special", g.String) -- other special strings (e.g. dates) 28 + 29 + Group.link("@character", g.Character) -- character literals 30 + Group.link("@character.special", g.Character) -- special characters (e.g. wildcards) 31 + 32 + Group.link("@boolean", g.Boolean) -- boolean literals 33 + Group.link("@number", g.Number) -- numeric literals 34 + Group.link("@float", g.Float) -- floating-point number literals 35 + 36 + -- Functions {{{1 37 + Group.link("@function", g.Function) -- function definitions 38 + Group.link("@function.builtin", g.Function) -- built-in functions 39 + -- Group.link("@function.call", g.UnknownThing) -- function calls 40 + Group.link("@function.macro", g.Function) -- preprocessor macros 41 + 42 + Group.link("@method", g.Function) -- method definitions 43 + -- Group.link("@method.call", g.UnknownThing) -- method calls 44 + 45 + Group.link("@constructor", g.Function) -- constructor calls and definitions 46 + Group.link("@parameter", g.Normal) -- parameters of a function 47 + 48 + -- Keywords {{{1 49 + Group.link("@keyword", g.Keyword) -- various keywords 50 + Group.link("@keyword.function", g.Keyword) -- keywords that define a function (e.g. `func` in Go, `def` in Python) 51 + Group.link("@keyword.operator", g.Keyword) -- operators that are English words (e.g. `and` / `or`) 52 + Group.link("@keyword.return", g.Keyword) -- keywords like `return` and `yield` 53 + 54 + Group.link("@conditional", g.Conditional) -- keywords related to conditionals (e.g. `if` / `else`) 55 + Group.link("@repeat", g.Repeat) -- keywords related to loops (e.g. `for` / `while`) 56 + -- Group.link("@debug", g.UnknownThing) -- keywords related to debugging 57 + Group.link("@label", g.Label) -- GOTO and other labels (e.g. `label:` in C) 58 + Group.link("@include", g.Include) -- keywords for including modules (e.g. `import` / `from` in Python) 59 + Group.link("@exception", g.Exception) -- keywords related to exceptions (e.g. `throw` / `catch`) 60 + 61 + -- Types {{{1 62 + Group.link("@type", g.Type) -- type or class definitions and annotations 63 + Group.link("@type.builtin", g.Type) -- built-in types 64 + -- Group.link("@type.definition", g.UnknownThing) -- type definitions (e.g. `typedef` in C) 65 + -- Group.link("@type.qualifier", g.UnknownThing) -- type qualifiers (e.g. `const`) 66 + 67 + -- Group.link("@storageclass", g.UnknownThing) -- visibility/life-time modifiers 68 + -- Group.link("@storageclass.lifetime", g.UnknownThing) -- life-time modifiers (e.g. `static`) 69 + -- Group.link("@attribute", g.UnknownThing) -- attribute annotations (e.g. Python decorators) 70 + -- Group.link("@field", g.UnknownThing) -- object and struct fields 71 + Group.link("@property", g.Identifier) -- similar to `@field` 72 + 73 + -- Identifiers {{{1 74 + Group.link("@variable", g.Identifier) -- various variable names 75 + -- Group.link("@variable.builtin", g.UnknownThing) -- built-in variable names (e.g. `this`) 76 + 77 + Group.link("@constant", g.Constant) -- constant identifiers 78 + -- Group.link("@constant.builtin", g.UnknownThing) -- built-in constant values 79 + -- Group.link("@constant.macro", g.UnknownThing) -- constants defined by the preprocessor 80 + 81 + Group.new("@namespace", c.namespace, c.none) -- modules or namespaces 82 + Group.link("@symbol", g.Special) -- symbols or atoms 83 + 84 + -- Text {{{1 85 + Group.link("@text", g.Normal) -- non-structured text 86 + Group.link("@text.strong", g.Normal) -- bold text 87 + Group.link("@text.emphasis", g.Normal) -- text with emphasis 88 + Group.link("@text.underline", g.Normal) -- underlined text 89 + Group.link("@text.strike", g.Normal) -- strikethrough text 90 + Group.link("@text.title", g.Normal) -- text that is part of a title 91 + Group.link("@text.literal", g.Normal) -- literal or verbatim text 92 + Group.link("@text.uri", g.UnknownThing) -- URIs (e.g. hyperlinks) 93 + Group.link("@text.math", g.UnknownThing) -- math environments (e.g. `$ ... $` in LaTeX) 94 + Group.link("@text.environment", g.UnknownThing) -- text environments of markup languages 95 + Group.link("@text.environment.name", g.UnknownThing) -- text indicating the type of an environment 96 + Group.link("@text.reference", g.Normal) -- text references, footnotes, citations, etc. 97 + 98 + -- I think the defaults are fine here? 99 + -- Group.link("@text.todo", g.TODO) -- todo notes 100 + Group.link("@text.note", g.Note) -- info notes 101 + Group.link("@text.warning", g.Warning) -- warning notes 102 + Group.link("@text.danger", g.Error) -- danger/error notes 103 + 104 + Group.link("@text.diff.add", g.DiffAdd) -- added text (for diff files) 105 + Group.link("@text.diff.delete", g.DiffDelete) -- deleted text (for diff files) 106 + 107 + -- Tags {{{1 108 + Group.link("@tag", g.Special) -- XML tag names 109 + Group.link("@tag.attribute", g.Special) -- XML tag attributes 110 + Group.link("@tag.delimiter", g.Special) -- XML tag delimiters 111 + 112 + -- Conceal {{{1 113 + -- Group.link("@conceal", g.UnknownThing) -- for captures that are only used for concealing 114 + 115 + -- Spell {{{1 116 + -- Group.link("@spell", g.UnknownThing) -- for defining regions to be spellchecked 117 + -- Other/Unknown {{{1 118 + 119 + -- Non-standard 120 + -- @variable.global 121 + 122 + -- Undocumented or invalid? 123 + Group.link("@annotation", g.UnknownThing) 124 + --Group.link("@parameter.reference", g.UnknownThing) 125 + -- }}}1 126 + end 127 + 128 + return M 129 + 130 + -- vim: set fdm=marker:
+3 -127
lua/wombat_lua/init.lua
··· 1 - -- vim: set fdm=marker: 2 - -- TODO port work config changes? 3 - 4 1 local wombat_colors = require "wombat_lua.colors" 5 2 6 3 local Color = require("colorbuddy.init").Color ··· 163 160 Group.link("DiagnosticError", g.Error) 164 161 Group.link("DiagnosticUnnecessary", g.NonText) 165 162 166 - -- Syntax - Treesitter {{{1 167 - Group.new("UnknownThing", c.norm, c.unknown) 168 - 169 - -- Structured following: 170 - -- https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights 171 - 172 - -- Misc {{{2 173 - 174 - -- @errors is TS errors. Wildly noisy if you enable it. 175 - --Group.link("@error", g.ErrorMsg) -- syntax/parser errors 176 - Group.link("@comment", g.Comment) -- line and block comments 177 - --Group.link("@none", g.UnknownThing) -- completely disable the highlight 178 - --Group.link("@preproc", g.UnknownThing) -- various preprocessor directives & shebangs 179 - --Group.link("@define", g.UnknownThing) -- preprocessor definition directives 180 - Group.link("@operator", g.Operator) -- symbolic operators (e.g. `+` / `*`) 181 - 182 - -- Punctuation {{{2 183 - Group.link("@punctuation.delimiter", g.Special) -- delimiters (e.g. `;` / `.` / `,`) 184 - Group.link("@punctuation.bracket", g.Special) -- brackets (e.g. `()` / `{}` / `[]`) 185 - Group.link("@punctuation.special", g.Special) -- special symbols (e.g. `{}` in string interpolation) 186 - 187 - -- Literals {{{2 188 - Group.link("@string", g.String) -- string literals 189 - Group.link("@string.regex", g.String) -- regular expressions 190 - Group.link("@string.escape", g.StringEscape) -- escape sequences 191 - Group.link("@string.special", g.String) -- other special strings (e.g. dates) 192 - 193 - Group.link("@character", g.Character) -- character literals 194 - Group.link("@character.special", g.Character) -- special characters (e.g. wildcards) 195 - 196 - Group.link("@boolean", g.Boolean) -- boolean literals 197 - Group.link("@number", g.Number) -- numeric literals 198 - Group.link("@float", g.Float) -- floating-point number literals 199 - 200 - -- Functions {{{2 201 - Group.link("@function", g.Function) -- function definitions 202 - Group.link("@function.builtin", g.Function) -- built-in functions 203 - --Group.link("@function.call", g.UnknownThing) -- function calls 204 - Group.link("@function.macro", g.Function) -- preprocessor macros 205 - 206 - Group.link("@method", g.Function) -- method definitions 207 - -- Group.link("@method.call", g.UnknownThing) -- method calls 208 - 209 - Group.link("@constructor", g.Function) -- constructor calls and definitions 210 - Group.link("@parameter", g.Normal) -- parameters of a function 211 - 212 - -- Keywords {{{2 213 - Group.link("@keyword", g.Keyword) -- various keywords 214 - Group.link("@keyword.function", g.Keyword) -- keywords that define a function (e.g. `func` in Go, `def` in Python) 215 - Group.link("@keyword.operator", g.Keyword) -- operators that are English words (e.g. `and` / `or`) 216 - Group.link("@keyword.return", g.Keyword) -- keywords like `return` and `yield` 217 - 218 - Group.link("@conditional", g.Conditional) -- keywords related to conditionals (e.g. `if` / `else`) 219 - Group.link("@repeat", g.Repeat) -- keywords related to loops (e.g. `for` / `while`) 220 - --Group.link("@debug", g.UnknownThing) -- keywords related to debugging 221 - Group.link("@label", g.Label) -- GOTO and other labels (e.g. `label:` in C) 222 - Group.link("@include", g.Include) -- keywords for including modules (e.g. `import` / `from` in Python) 223 - Group.link("@exception", g.Exception) -- keywords related to exceptions (e.g. `throw` / `catch`) 224 - 225 - -- Types {{{2 226 - Group.link("@type", g.Type) -- type or class definitions and annotations 227 - Group.link("@type.builtin", g.Type) -- built-in types 228 - --Group.link("@type.definition", g.UnknownThing) -- type definitions (e.g. `typedef` in C) 229 - --Group.link("@type.qualifier", g.UnknownThing) -- type qualifiers (e.g. `const`) 230 - 231 - --Group.link("@storageclass", g.UnknownThing) -- visibility/life-time modifiers 232 - --Group.link("@storageclass.lifetime", g.UnknownThing) -- life-time modifiers (e.g. `static`) 233 - --Group.link("@attribute", g.UnknownThing) -- attribute annotations (e.g. Python decorators) 234 - --Group.link("@field", g.UnknownThing) -- object and struct fields 235 - Group.link("@property", g.Identifier) -- similar to `@field` 236 - 237 - -- Identifiers {{{2 238 - Group.link("@variable", g.Identifier) -- various variable names 239 - --Group.link("@variable.builtin", g.UnknownThing) -- built-in variable names (e.g. `this`) 240 - 241 - Group.link("@constant", g.Constant) -- constant identifiers 242 - --Group.link("@constant.builtin", g.UnknownThing) -- built-in constant values 243 - --Group.link("@constant.macro", g.UnknownThing) -- constants defined by the preprocessor 244 - 245 - Group.new("@namespace", c.namespace, c.none) -- modules or namespaces 246 - Group.link("@symbol", g.Special) -- symbols or atoms 247 - 248 - -- Text {{{2 249 - Group.link("@text", g.Normal) -- non-structured text 250 - Group.link("@text.strong", g.Normal) -- bold text 251 - Group.link("@text.emphasis", g.Normal) -- text with emphasis 252 - Group.link("@text.underline", g.Normal) -- underlined text 253 - Group.link("@text.strike", g.Normal) -- strikethrough text 254 - Group.link("@text.title", g.Normal) -- text that is part of a title 255 - Group.link("@text.literal", g.Normal) -- literal or verbatim text 256 - Group.link("@text.uri", g.UnknownThing) -- URIs (e.g. hyperlinks) 257 - Group.link("@text.math", g.UnknownThing) -- math environments (e.g. `$ ... $` in LaTeX) 258 - Group.link("@text.environment", g.UnknownThing) -- text environments of markup languages 259 - Group.link("@text.environment.name", g.UnknownThing) -- text indicating the type of an environment 260 - Group.link("@text.reference", g.Normal) -- text references, footnotes, citations, etc. 261 - 262 - -- I think the defaults are fine here? 263 - -- Group.link("@text.todo", g.TODO) -- todo notes 264 - Group.link("@text.note", g.Note) -- info notes 265 - Group.link("@text.warning", g.Warning) -- warning notes 266 - Group.link("@text.danger", g.Error) -- danger/error notes 267 - 268 - Group.link("@text.diff.add", g.DiffAdd) -- added text (for diff files) 269 - Group.link("@text.diff.delete", g.DiffDelete) -- deleted text (for diff files) 270 - 271 - -- Tags {{{2 272 - Group.link("@tag", g.Special) -- XML tag names 273 - Group.link("@tag.attribute", g.Special) -- XML tag attributes 274 - Group.link("@tag.delimiter", g.Special) -- XML tag delimiters 275 - 276 - -- Conceal {{{2 277 - --Group.link("@conceal", g.UnknownThing) -- for captures that are only used for concealing 278 - 279 - -- Spell {{{2 280 - --Group.link("@spell", g.UnknownThing) -- for defining regions to be spellchecked 281 - 282 - -- Non-standard 283 - -- @variable.global 284 - 285 - ------------------------------------- 286 - 287 - -- Undocumented or invalid? 288 - Group.link("@annotation", g.UnknownThing) 289 - --Group.link("@parameter.reference", g.UnknownThing) 163 + require("wombat_lua.groups.treesitter").build(Group, c, g, s) 290 164 291 165 Group.new("TODO", c.none, c.none) -- what even set this? 292 166 ··· 304 178 305 179 Group.new("IblIndent", c.bg_more_subtle, c.none, s.none) 306 180 Group.new("IblScope", c.norm_accent, c.none, s.none) 181 + 182 + -- vim: set fdm=marker: