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