123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355 |
- (identifier) @variable
- ((identifier) @constant
- (#lua-match? @constant "^[A-Z][A-Z_0-9]*$"))
- ; Keywords
- [
- "if"
- "else"
- "elseif"
- "endif"
- ] @keyword.conditional
- [
- "try"
- "catch"
- "finally"
- "endtry"
- "throw"
- ] @keyword.exception
- [
- "for"
- "endfor"
- "in"
- "while"
- "endwhile"
- "break"
- "continue"
- ] @keyword.repeat
- [
- "function"
- "endfunction"
- ] @keyword.function
- ; Function related
- (function_declaration
- name: (_) @function)
- (call_expression
- function: (identifier) @function.call)
- (call_expression
- function: (scoped_identifier
- (identifier) @function.call))
- (parameters
- (identifier) @variable.parameter)
- (default_parameter
- (identifier) @variable.parameter)
- [
- (bang)
- (spread)
- ] @punctuation.special
- [
- (no_option)
- (inv_option)
- (default_option)
- (option_name)
- ] @variable.builtin
- [
- (scope)
- "a:"
- "$"
- ] @module
- ; Commands and user defined commands
- [
- "let"
- "unlet"
- "const"
- "call"
- "execute"
- "normal"
- "set"
- "setfiletype"
- "setlocal"
- "silent"
- "echo"
- "echon"
- "echohl"
- "echomsg"
- "echoerr"
- "autocmd"
- "augroup"
- "return"
- "syntax"
- "filetype"
- "source"
- "lua"
- "ruby"
- "perl"
- "python"
- "highlight"
- "command"
- "delcommand"
- "comclear"
- "colorscheme"
- "scriptencoding"
- "startinsert"
- "stopinsert"
- "global"
- "runtime"
- "wincmd"
- "cnext"
- "cprevious"
- "cNext"
- "vertical"
- "leftabove"
- "aboveleft"
- "rightbelow"
- "belowright"
- "topleft"
- "botright"
- (unknown_command_name)
- "edit"
- "enew"
- "find"
- "ex"
- "visual"
- "view"
- "eval"
- "sign"
- "abort"
- ] @keyword
- (map_statement
- cmd: _ @keyword)
- (keycode) @character.special
- (command_name) @function.macro
- ; Filetype command
- (filetype_statement
- [
- "detect"
- "plugin"
- "indent"
- "on"
- "off"
- ] @keyword)
- ; Syntax command
- (syntax_statement
- (keyword) @string)
- (syntax_statement
- [
- "enable"
- "on"
- "off"
- "reset"
- "case"
- "spell"
- "foldlevel"
- "iskeyword"
- "keyword"
- "match"
- "cluster"
- "region"
- "clear"
- "include"
- ] @keyword)
- (syntax_argument
- name: _ @keyword)
- [
- "<buffer>"
- "<nowait>"
- "<silent>"
- "<script>"
- "<expr>"
- "<unique>"
- ] @constant.builtin
- (augroup_name) @module
- (au_event) @constant
- (normal_statement
- (commands) @constant)
- ; Highlight command
- (hl_attribute
- key: _ @property
- val: _ @constant)
- (hl_group) @type
- (highlight_statement
- [
- "default"
- "link"
- "clear"
- ] @keyword)
- ; Command command
- (command) @string
- (command_attribute
- name: _ @property
- val: (behavior
- name: _ @constant
- val: (identifier)? @function)?)
- ; Edit command
- (plus_plus_opt
- val: _? @constant) @property
- (plus_cmd
- "+" @property) @property
- ; Runtime command
- (runtime_statement
- (where) @keyword.operator)
- ; Colorscheme command
- (colorscheme_statement
- (name) @string)
- ; Scriptencoding command
- (scriptencoding_statement
- (encoding) @string.special)
- ; Literals
- (string_literal) @string
- (integer_literal) @number
- (float_literal) @number.float
- (comment) @comment @spell
- (line_continuation_comment) @comment @spell
- (pattern) @string.special
- (pattern_multi) @string.regexp
- (filename) @string.special.path
- (heredoc
- (body) @string)
- (heredoc
- (parameter) @keyword)
- [
- (marker_definition)
- (endmarker)
- ] @label
- (literal_dictionary
- (literal_key) @property)
- ((scoped_identifier
- (scope) @_scope
- .
- (identifier) @boolean)
- (#eq? @_scope "v:")
- (#any-of? @boolean "true" "false"))
- ; Operators
- [
- "||"
- "&&"
- "&"
- "+"
- "-"
- "*"
- "/"
- "%"
- ".."
- "=="
- "!="
- ">"
- ">="
- "<"
- "<="
- "=~"
- "!~"
- "="
- "^="
- "+="
- "-="
- "*="
- "/="
- "%="
- ".="
- "..="
- "<<"
- "=<<"
- "->"
- (match_case)
- ] @operator
- [
- "is"
- "isnot"
- ] @keyword.operator
- ; Some characters have different meanings based on the context
- (unary_operation
- "!" @operator)
- (binary_operation
- "." @operator)
- ; Punctuation
- [
- "("
- ")"
- "{"
- "}"
- "["
- "]"
- "#{"
- ] @punctuation.bracket
- (field_expression
- "." @punctuation.delimiter)
- [
- ","
- ":"
- ] @punctuation.delimiter
- (ternary_expression
- [
- "?"
- ":"
- ] @keyword.conditional.ternary)
- ; Options
- ((set_value) @number
- (#lua-match? @number "^[%d]+(%.[%d]+)?$"))
- (inv_option
- "!" @operator)
- (set_item
- "?" @operator)
- ((set_item
- option: (option_name) @_option
- value: (set_value) @function)
- (#any-of? @_option "tagfunc" "tfu" "completefunc" "cfu" "omnifunc" "ofu" "operatorfunc" "opfunc"))
|