mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 11:50:09 -04:00
add highlight queries for bash
This commit is contained in:
parent
35dfd7e1f4
commit
51a52b85cf
2 changed files with 111 additions and 1 deletions
|
|
@ -168,7 +168,7 @@ List of currently supported languages:
|
||||||
- [x] css (maintained by @TravonteD)
|
- [x] css (maintained by @TravonteD)
|
||||||
- [ ] julia
|
- [ ] julia
|
||||||
- [ ] php
|
- [ ] php
|
||||||
- [ ] bash
|
- [x] bash (maintained by @TravonteD)
|
||||||
- [ ] scala
|
- [ ] scala
|
||||||
- [ ] haskell
|
- [ ] haskell
|
||||||
- [ ] toml
|
- [ ] toml
|
||||||
|
|
|
||||||
110
queries/bash/highlights.scm
Normal file
110
queries/bash/highlights.scm
Normal file
|
|
@ -0,0 +1,110 @@
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
[
|
||||||
|
";"
|
||||||
|
";;"
|
||||||
|
(heredoc_start)
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
[
|
||||||
|
">"
|
||||||
|
"<"
|
||||||
|
"&"
|
||||||
|
"&&"
|
||||||
|
"|"
|
||||||
|
"||"
|
||||||
|
"="
|
||||||
|
"=="
|
||||||
|
"!="
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
[
|
||||||
|
(string)
|
||||||
|
(raw_string)
|
||||||
|
(heredoc_body)
|
||||||
|
] @string
|
||||||
|
|
||||||
|
[
|
||||||
|
"if"
|
||||||
|
"then"
|
||||||
|
"else"
|
||||||
|
"elif"
|
||||||
|
"fi"
|
||||||
|
"case"
|
||||||
|
"in"
|
||||||
|
"esac"
|
||||||
|
] @conditional
|
||||||
|
|
||||||
|
[
|
||||||
|
"for"
|
||||||
|
"do"
|
||||||
|
"done"
|
||||||
|
"while"
|
||||||
|
] @repeat
|
||||||
|
|
||||||
|
[
|
||||||
|
"declare"
|
||||||
|
"export"
|
||||||
|
"local"
|
||||||
|
"readonly"
|
||||||
|
"unset"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
[
|
||||||
|
(special_variable_name)
|
||||||
|
("$" (special_variable_name))
|
||||||
|
] @constant
|
||||||
|
|
||||||
|
((word) @constant
|
||||||
|
(#match? @constant "SIG(INT|TERM|QUIT|TIN|TOU|STP|HUP)"))
|
||||||
|
|
||||||
|
((word) @boolean
|
||||||
|
(#match? @boolean "true|false"))
|
||||||
|
|
||||||
|
((word) @number
|
||||||
|
(#match? @number "^\d*$"))
|
||||||
|
|
||||||
|
(comment) @comment
|
||||||
|
(test_operator) @string.
|
||||||
|
|
||||||
|
(command_substitution
|
||||||
|
[ "$(" ")" ] @punctuation.bracket)
|
||||||
|
|
||||||
|
|
||||||
|
(function_definition
|
||||||
|
name: (word) @function)
|
||||||
|
|
||||||
|
(command_name (word)) @function
|
||||||
|
|
||||||
|
(command
|
||||||
|
argument: [
|
||||||
|
(word) @parameter
|
||||||
|
((word) @number
|
||||||
|
(#match? @number "^\d*$"))
|
||||||
|
(concatenation (word) @parameter)
|
||||||
|
])
|
||||||
|
|
||||||
|
(file_redirect
|
||||||
|
descriptor: (file_descriptor) @operator
|
||||||
|
destination: (word) @parameter)
|
||||||
|
|
||||||
|
|
||||||
|
("$" (variable_name)) @identifier
|
||||||
|
|
||||||
|
(expansion
|
||||||
|
[ "${" "}" ] @punctuation.bracket)
|
||||||
|
|
||||||
|
(variable_name) @identifier
|
||||||
|
|
||||||
|
(case_item
|
||||||
|
value: (word) @parameter)
|
||||||
|
|
||||||
|
(concatenation (word) @parameter)
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue