highlights.scm (4531B)
1 (identifier) @variable 2 3 ((identifier) @constant 4 (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) 5 6 ; Keywords 7 [ 8 "if" 9 "else" 10 "elseif" 11 "endif" 12 ] @keyword.conditional 13 14 [ 15 "try" 16 "catch" 17 "finally" 18 "endtry" 19 "throw" 20 ] @keyword.exception 21 22 [ 23 "for" 24 "endfor" 25 "in" 26 "while" 27 "endwhile" 28 "break" 29 "continue" 30 ] @keyword.repeat 31 32 [ 33 "function" 34 "endfunction" 35 ] @keyword.function 36 37 ; Function related 38 (function_declaration 39 name: (_) @function) 40 41 (call_expression 42 function: (identifier) @function.call) 43 44 (call_expression 45 function: (scoped_identifier 46 (identifier) @function.call)) 47 48 (parameters 49 (identifier) @variable.parameter) 50 51 (default_parameter 52 (identifier) @variable.parameter) 53 54 [ 55 (bang) 56 (spread) 57 ] @punctuation.special 58 59 [ 60 (no_option) 61 (inv_option) 62 (default_option) 63 (option_name) 64 ] @variable.builtin 65 66 [ 67 (scope) 68 "a:" 69 "$" 70 ] @module 71 72 ; Commands and user defined commands 73 [ 74 "let" 75 "unlet" 76 "const" 77 "call" 78 "execute" 79 "normal" 80 "set" 81 "setfiletype" 82 "setlocal" 83 "silent" 84 "echo" 85 "echon" 86 "echohl" 87 "echomsg" 88 "echoerr" 89 "autocmd" 90 "augroup" 91 "return" 92 "syntax" 93 "filetype" 94 "source" 95 "lua" 96 "ruby" 97 "perl" 98 "python" 99 "highlight" 100 "command" 101 "delcommand" 102 "comclear" 103 "colorscheme" 104 "scriptencoding" 105 "startinsert" 106 "stopinsert" 107 "global" 108 "runtime" 109 "wincmd" 110 "cnext" 111 "cprevious" 112 "cNext" 113 "tab" 114 "vertical" 115 "leftabove" 116 "aboveleft" 117 "rightbelow" 118 "belowright" 119 "topleft" 120 "botright" 121 (unknown_command_name) 122 "edit" 123 "enew" 124 "find" 125 "ex" 126 "visual" 127 "view" 128 "eval" 129 "sign" 130 "abort" 131 "substitute" 132 ] @keyword 133 134 (map_statement 135 cmd: _ @keyword) 136 137 (keycode) @character.special 138 139 (command_name) @function.macro 140 141 ; Filetype command 142 (filetype_statement 143 [ 144 "detect" 145 "plugin" 146 "indent" 147 "on" 148 "off" 149 ] @keyword) 150 151 ; Syntax command 152 (syntax_statement 153 (keyword) @string) 154 155 (syntax_statement 156 [ 157 "enable" 158 "on" 159 "off" 160 "reset" 161 "case" 162 "spell" 163 "foldlevel" 164 "iskeyword" 165 "keyword" 166 "match" 167 "cluster" 168 "region" 169 "clear" 170 "include" 171 ] @keyword) 172 173 (syntax_argument 174 name: _ @keyword) 175 176 [ 177 "<buffer>" 178 "<nowait>" 179 "<silent>" 180 "<script>" 181 "<expr>" 182 "<unique>" 183 ] @constant.builtin 184 185 (augroup_name) @module 186 187 (au_event) @constant 188 189 (normal_statement 190 (commands) @constant) 191 192 ; Highlight command 193 (hl_attribute 194 key: _ @property 195 val: _ @constant) 196 197 (hl_group) @type 198 199 (highlight_statement 200 [ 201 "default" 202 "link" 203 "clear" 204 ] @keyword) 205 206 ; Command command 207 (command) @string 208 209 (command_attribute 210 name: _ @property 211 val: (behavior 212 name: _ @constant 213 val: (identifier)? @function)?) 214 215 ; Edit command 216 (plus_plus_opt 217 val: _? @constant) @property 218 219 (plus_cmd 220 "+" @property) @property 221 222 ; Runtime command 223 (runtime_statement 224 (where) @keyword.operator) 225 226 ; Colorscheme command 227 (colorscheme_statement 228 (name) @string) 229 230 ; Scriptencoding command 231 (scriptencoding_statement 232 (encoding) @string.special) 233 234 ; Literals 235 (string_literal) @string 236 237 (integer_literal) @number 238 239 (float_literal) @number.float 240 241 (comment) @comment @spell 242 243 (line_continuation_comment) @comment @spell 244 245 (pattern) @string.special 246 247 (pattern_multi) @string.regexp 248 249 (filename) @string.special.path 250 251 (heredoc 252 (body) @string) 253 254 (heredoc 255 (parameter) @keyword) 256 257 (script 258 (parameter) @keyword) 259 260 [ 261 (marker_definition) 262 (endmarker) 263 ] @label 264 265 (literal_dictionary 266 (literal_key) @property) 267 268 ((scoped_identifier 269 (scope) @_scope 270 . 271 (identifier) @boolean) 272 (#eq? @_scope "v:") 273 (#any-of? @boolean "true" "false")) 274 275 ; Operators 276 [ 277 "||" 278 "&&" 279 "&" 280 "+" 281 "-" 282 "*" 283 "/" 284 "%" 285 ".." 286 "==" 287 "!=" 288 ">" 289 ">=" 290 "<" 291 "<=" 292 "=~" 293 "!~" 294 "=" 295 "^=" 296 "+=" 297 "-=" 298 "*=" 299 "/=" 300 "%=" 301 ".=" 302 "..=" 303 "<<" 304 "=<<" 305 "->" 306 (match_case) 307 ] @operator 308 309 [ 310 "is" 311 "isnot" 312 ] @keyword.operator 313 314 ; Some characters have different meanings based on the context 315 (unary_operation 316 "!" @operator) 317 318 (binary_operation 319 "." @operator) 320 321 (lua_statement 322 "=" @keyword) 323 324 ; Punctuation 325 [ 326 "(" 327 ")" 328 "{" 329 "}" 330 "[" 331 "]" 332 "#{" 333 ] @punctuation.bracket 334 335 (field_expression 336 "." @punctuation.delimiter) 337 338 [ 339 "," 340 ":" 341 ] @punctuation.delimiter 342 343 (ternary_expression 344 [ 345 "?" 346 ":" 347 ] @keyword.conditional.ternary) 348 349 ; Options 350 ((set_value) @number 351 (#lua-match? @number "^[%d]+(%.[%d]+)?$")) 352 353 (inv_option 354 "!" @operator) 355 356 (set_item 357 "?" @operator) 358 359 ((set_item 360 option: (option_name) @_option 361 value: (set_value) @function) 362 (#any-of? @_option "tagfunc" "tfu" "completefunc" "cfu" "omnifunc" "ofu" "operatorfunc" "opfunc"))