Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/fish/highlights.scm')
-rw-r--r--runtime/queries/fish/highlights.scm22
1 files changed, 13 insertions, 9 deletions
diff --git a/runtime/queries/fish/highlights.scm b/runtime/queries/fish/highlights.scm
index 27d509a0..d9b5b427 100644
--- a/runtime/queries/fish/highlights.scm
+++ b/runtime/queries/fish/highlights.scm
@@ -4,14 +4,13 @@
"&&"
"||"
"|"
+ "&|"
+ "2>|"
"&"
- "="
- "!="
".."
"!"
(direction)
(stream_redirect)
- (test_option)
] @operator
[
@@ -39,12 +38,12 @@
"case"
] @keyword.control.conditional)
-(else_clause
+(else_clause
[
"else"
] @keyword.control.conditional)
-(else_if_clause
+(else_if_clause
[
"else"
"if"
@@ -96,6 +95,14 @@
;; Commands
(command
+ name: (word) @function.builtin (#match? @function.builtin "^test$")
+ argument: (word) @operator (#match? @operator "^(!?=|-[a-zA-Z]+)$"))
+
+(command
+ name: (word) @punctuation.bracket (#match? @punctuation.bracket "^\\[$")
+ argument: (word) @operator (#match? @operator "^(!?=|-[a-zA-Z]+)$"))
+
+(command
argument: [
(word) @variable.parameter (#match? @variable.parameter "^-")
]
@@ -109,8 +116,6 @@
]
)
-(test_command "test" @function.builtin)
-
; non-builtin command names
(command name: (word) @function)
@@ -121,7 +126,7 @@
(function_definition
name: [
(word) (concatenation)
- ]
+ ]
@function)
(function_definition
@@ -146,7 +151,6 @@
(integer) @constant.numeric.integer
(float) @constant.numeric.float
(comment) @comment
-(test_option) @string
((word) @constant.builtin.boolean
(#match? @constant.builtin.boolean "^(true|false)$"))