aboutsummaryrefslogtreecommitdiffstats
path: root/queries/bash
diff options
context:
space:
mode:
authorTravonteD <tman1300@aol.com>2020-06-22 17:39:54 -0400
committerThomas Vigouroux <39092278+vigoux@users.noreply.github.com>2020-06-23 16:15:19 +0200
commit51a52b85cf9fdc4d67619e0d71c57c1e6bb0f988 (patch)
tree89d729ebc283fd563b51b263552b03b63c286c5e /queries/bash
parentUpdate CONTRIBUTING.md (diff)
downloadnvim-treesitter-51a52b85cf9fdc4d67619e0d71c57c1e6bb0f988.tar
nvim-treesitter-51a52b85cf9fdc4d67619e0d71c57c1e6bb0f988.tar.gz
nvim-treesitter-51a52b85cf9fdc4d67619e0d71c57c1e6bb0f988.tar.bz2
nvim-treesitter-51a52b85cf9fdc4d67619e0d71c57c1e6bb0f988.tar.lz
nvim-treesitter-51a52b85cf9fdc4d67619e0d71c57c1e6bb0f988.tar.xz
nvim-treesitter-51a52b85cf9fdc4d67619e0d71c57c1e6bb0f988.tar.zst
nvim-treesitter-51a52b85cf9fdc4d67619e0d71c57c1e6bb0f988.zip
add highlight queries for bash
Diffstat (limited to 'queries/bash')
-rw-r--r--queries/bash/highlights.scm110
1 files changed, 110 insertions, 0 deletions
diff --git a/queries/bash/highlights.scm b/queries/bash/highlights.scm
new file mode 100644
index 000000000..c0ec8d698
--- /dev/null
+++ b/queries/bash/highlights.scm
@@ -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)
+