(identifier) @variable ((identifier) @constant (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) ;; Keywords [ "if" "else" "elseif" "endif" ] @conditional [ "try" "catch" "finally" "endtry" "throw" ] @exception [ "for" "endfor" "in" "while" "endwhile" "break" "continue" ] @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) @parameter) (default_parameter (identifier) @parameter) [ (bang) (spread) ] @punctuation.special [ (no_option) (inv_option) (default_option) (option_name) ] @variable.builtin [ (scope) "a:" "$" ] @namespace ;; 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" "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" ] @keyword (map_statement cmd: _ @keyword) (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) [ "" "" "" "