2020-06-22 17:39:54 -04:00
|
|
|
[
|
2023-08-23 13:02:30 +03:00
|
|
|
"(" ")"
|
|
|
|
|
"{" "}"
|
|
|
|
|
"[" "]"
|
|
|
|
|
"[[" "]]"
|
2023-08-24 17:12:10 -04:00
|
|
|
"((" "))"
|
2023-08-23 13:02:30 +03:00
|
|
|
] @punctuation.bracket
|
2020-06-22 17:39:54 -04:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
";"
|
|
|
|
|
";;"
|
2023-08-24 17:12:10 -04:00
|
|
|
";&"
|
|
|
|
|
";;&"
|
2023-08-23 13:02:30 +03:00
|
|
|
"&"
|
|
|
|
|
] @punctuation.delimiter
|
2020-09-06 12:31:40 -05:00
|
|
|
|
2020-06-22 17:39:54 -04:00
|
|
|
[
|
|
|
|
|
">"
|
2022-03-16 13:37:39 +01:00
|
|
|
">>"
|
2020-06-22 17:39:54 -04:00
|
|
|
"<"
|
2022-03-16 13:37:39 +01:00
|
|
|
"<<"
|
2020-06-22 17:39:54 -04:00
|
|
|
"&&"
|
|
|
|
|
"|"
|
2023-08-24 17:12:10 -04:00
|
|
|
"|&"
|
2020-06-22 17:39:54 -04:00
|
|
|
"||"
|
|
|
|
|
"="
|
2023-08-24 17:12:10 -04:00
|
|
|
"+="
|
2020-12-19 20:59:02 +00:00
|
|
|
"=~"
|
2020-06-22 17:39:54 -04:00
|
|
|
"=="
|
|
|
|
|
"!="
|
2023-08-24 17:12:10 -04:00
|
|
|
|
|
|
|
|
"&>"
|
|
|
|
|
"&>>"
|
|
|
|
|
"<&"
|
|
|
|
|
">&"
|
|
|
|
|
">|"
|
2023-08-30 14:17:40 -04:00
|
|
|
"<&-"
|
|
|
|
|
">&-"
|
2023-08-24 17:12:10 -04:00
|
|
|
|
|
|
|
|
"<<-"
|
|
|
|
|
"<<<"
|
|
|
|
|
|
|
|
|
|
".."
|
2023-08-23 13:02:30 +03:00
|
|
|
] @operator
|
2020-06-22 17:39:54 -04:00
|
|
|
|
2023-08-07 13:42:24 +01:00
|
|
|
; Do *not* spell check strings since they typically have some sort of
|
|
|
|
|
; interpolation in them, or, are typically used for things like filenames, URLs,
|
|
|
|
|
; flags and file content.
|
2020-06-22 17:39:54 -04:00
|
|
|
[
|
2020-08-16 11:24:10 -05:00
|
|
|
(string)
|
2020-06-22 17:39:54 -04:00
|
|
|
(raw_string)
|
2022-10-23 18:57:56 +09:00
|
|
|
(ansi_c_string)
|
2020-06-22 17:39:54 -04:00
|
|
|
(heredoc_body)
|
2023-08-07 13:42:24 +01:00
|
|
|
] @string
|
2020-06-22 17:39:54 -04:00
|
|
|
|
2023-08-23 13:02:30 +03:00
|
|
|
[
|
|
|
|
|
(heredoc_start)
|
|
|
|
|
(heredoc_end)
|
|
|
|
|
] @label
|
|
|
|
|
|
2020-09-06 12:31:40 -05:00
|
|
|
(variable_assignment (word) @string)
|
2023-08-24 17:12:10 -04:00
|
|
|
(command argument: "$" @string) ; bare dollar
|
2020-09-06 12:31:40 -05:00
|
|
|
|
2020-06-22 17:39:54 -04:00
|
|
|
[
|
|
|
|
|
"if"
|
|
|
|
|
"then"
|
|
|
|
|
"else"
|
|
|
|
|
"elif"
|
|
|
|
|
"fi"
|
|
|
|
|
"case"
|
|
|
|
|
"in"
|
|
|
|
|
"esac"
|
2023-08-23 13:02:30 +03:00
|
|
|
] @conditional
|
2020-06-22 17:39:54 -04:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"for"
|
|
|
|
|
"do"
|
|
|
|
|
"done"
|
2023-05-30 20:28:04 -04:00
|
|
|
"select"
|
2023-06-05 12:32:53 -04:00
|
|
|
"until"
|
2020-06-22 17:39:54 -04:00
|
|
|
"while"
|
2023-08-23 13:02:30 +03:00
|
|
|
] @repeat
|
2020-06-22 17:39:54 -04:00
|
|
|
|
|
|
|
|
[
|
2023-08-24 17:12:10 -04:00
|
|
|
"declare"
|
|
|
|
|
"typeset"
|
|
|
|
|
"export"
|
|
|
|
|
"readonly"
|
|
|
|
|
"local"
|
|
|
|
|
"unset"
|
|
|
|
|
"unsetenv"
|
2023-08-23 13:02:30 +03:00
|
|
|
] @keyword
|
2020-06-22 17:39:54 -04:00
|
|
|
|
2021-07-05 15:04:42 -05:00
|
|
|
"function" @keyword.function
|
|
|
|
|
|
2020-09-12 18:32:48 -05:00
|
|
|
(special_variable_name) @constant
|
2020-06-22 17:39:54 -04:00
|
|
|
|
2022-09-18 20:39:53 +03:00
|
|
|
; trap -l
|
2020-09-12 18:32:48 -05:00
|
|
|
((word) @constant.builtin
|
2022-09-18 20:39:53 +03:00
|
|
|
(#match? @constant.builtin "^SIG(HUP|INT|QUIT|ILL|TRAP|ABRT|BUS|FPE|KILL|USR[12]|SEGV|PIPE|ALRM|TERM|STKFLT|CHLD|CONT|STOP|TSTP|TT(IN|OU)|URG|XCPU|XFSZ|VTALRM|PROF|WINCH|IO|PWR|SYS|RTMIN([+]([1-9]|1[0-5]))?|RTMAX(-([1-9]|1[0-4]))?)$"))
|
2020-06-22 17:39:54 -04:00
|
|
|
|
|
|
|
|
((word) @boolean
|
2023-08-23 13:02:30 +03:00
|
|
|
(#any-of? @boolean "true" "false"))
|
2020-06-22 17:39:54 -04:00
|
|
|
|
2022-09-26 10:19:02 +01:00
|
|
|
(comment) @comment @spell
|
2020-06-22 17:39:54 -04:00
|
|
|
|
2023-08-23 13:02:30 +03:00
|
|
|
(test_operator) @operator
|
|
|
|
|
|
|
|
|
|
(command_substitution "$(" @punctuation.bracket)
|
|
|
|
|
(process_substitution "<(" @punctuation.bracket)
|
|
|
|
|
|
|
|
|
|
(arithmetic_expansion
|
|
|
|
|
[ "$((" "((" ] @punctuation.special
|
|
|
|
|
"))" @punctuation.special)
|
|
|
|
|
|
|
|
|
|
(arithmetic_expansion "," @punctuation.delimiter)
|
2020-06-22 17:39:54 -04:00
|
|
|
|
2023-08-23 13:02:30 +03:00
|
|
|
(ternary_expression [ "?" ":" ] @conditional.ternary)
|
2021-12-14 18:58:10 +01:00
|
|
|
|
2023-08-23 13:02:30 +03:00
|
|
|
(binary_expression operator: _ @operator)
|
|
|
|
|
(unary_expression operator: _ @operator)
|
|
|
|
|
(postfix_expression operator: _ @operator)
|
2020-06-22 17:39:54 -04:00
|
|
|
|
|
|
|
|
(function_definition
|
|
|
|
|
name: (word) @function)
|
|
|
|
|
|
2022-07-29 21:09:58 -03:00
|
|
|
(command_name (word) @function.call)
|
2020-09-12 18:32:48 -05:00
|
|
|
|
|
|
|
|
((command_name (word) @function.builtin)
|
2021-06-24 14:45:31 -04:00
|
|
|
(#any-of? @function.builtin
|
2023-06-18 10:46:56 +02:00
|
|
|
"alias" "bg" "bind" "break" "builtin" "caller" "cd"
|
|
|
|
|
"command" "compgen" "complete" "compopt" "continue"
|
|
|
|
|
"coproc" "dirs" "disown" "echo" "enable" "eval"
|
|
|
|
|
"exec" "exit" "fc" "fg" "getopts" "hash" "help"
|
|
|
|
|
"history" "jobs" "kill" "let" "logout" "mapfile"
|
|
|
|
|
"popd" "printf" "pushd" "pwd" "read" "readarray"
|
|
|
|
|
"return" "set" "shift" "shopt" "source" "suspend"
|
|
|
|
|
"test" "time" "times" "trap" "type" "typeset"
|
|
|
|
|
"ulimit" "umask" "unalias" "wait"))
|
2020-06-22 17:39:54 -04:00
|
|
|
|
2020-08-16 11:24:10 -05:00
|
|
|
(command
|
2020-06-22 17:39:54 -04:00
|
|
|
argument: [
|
|
|
|
|
(word) @parameter
|
|
|
|
|
(concatenation (word) @parameter)
|
|
|
|
|
])
|
|
|
|
|
|
2023-08-23 13:02:30 +03:00
|
|
|
(number) @number
|
2020-12-24 19:48:02 +00:00
|
|
|
((word) @number
|
2023-08-23 13:02:30 +03:00
|
|
|
(#lua-match? @number "^[0-9]+$"))
|
2020-12-19 20:31:55 +00:00
|
|
|
|
2020-06-22 17:39:54 -04:00
|
|
|
(file_redirect
|
|
|
|
|
destination: (word) @parameter)
|
|
|
|
|
|
2023-08-24 17:12:10 -04:00
|
|
|
(file_descriptor) @operator
|
|
|
|
|
|
2023-08-23 13:02:30 +03:00
|
|
|
(simple_expansion
|
|
|
|
|
"$" @punctuation.special) @none
|
2020-08-16 11:24:10 -05:00
|
|
|
(expansion
|
2023-08-23 13:02:30 +03:00
|
|
|
"${" @punctuation.special
|
|
|
|
|
"}" @punctuation.special) @none
|
|
|
|
|
|
|
|
|
|
(expansion operator: _ @punctuation.special)
|
|
|
|
|
(expansion "@" . operator: _ @character.special)
|
|
|
|
|
|
|
|
|
|
((expansion
|
|
|
|
|
(subscript
|
|
|
|
|
index: (word) @character.special))
|
|
|
|
|
(#any-of? @character.special "@" "*"))
|
2020-06-22 17:39:54 -04:00
|
|
|
|
2023-08-24 17:12:10 -04:00
|
|
|
"``" @punctuation.special
|
|
|
|
|
|
2020-09-07 18:14:54 +02:00
|
|
|
(variable_name) @variable
|
2020-06-22 17:39:54 -04:00
|
|
|
|
2020-09-12 18:32:48 -05:00
|
|
|
((variable_name) @constant
|
2021-11-18 09:51:03 +00:00
|
|
|
(#lua-match? @constant "^[A-Z][A-Z_0-9]*$"))
|
2020-09-12 18:32:48 -05:00
|
|
|
|
2020-08-16 11:24:10 -05:00
|
|
|
(case_item
|
2020-06-22 17:39:54 -04:00
|
|
|
value: (word) @parameter)
|
2020-12-19 20:59:02 +00:00
|
|
|
|
2023-08-24 17:12:10 -04:00
|
|
|
[
|
|
|
|
|
(regex)
|
|
|
|
|
(extglob_pattern)
|
|
|
|
|
] @string.regex
|
2022-09-18 20:15:23 +03:00
|
|
|
|
|
|
|
|
((program . (comment) @preproc)
|
2023-08-23 13:02:30 +03:00
|
|
|
(#lua-match? @preproc "^#!/"))
|