this repo has no description
at 66eeccae3e856303a1cae42632f6c083c8b46a32 130 lines 6.4 kB view raw
1local M = {} 2 3function 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 126end 127 128return M 129 130-- vim: set fdm=marker: