mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Viml: update queries
This commit is contained in:
parent
012e2161e3
commit
79a0230dbd
2 changed files with 36 additions and 4 deletions
|
|
@ -1,3 +1,7 @@
|
|||
(identifier) @variable
|
||||
((identifier) @constant
|
||||
(#match? @constant "^[A-Z][A-Z_0-9]*$"))
|
||||
|
||||
;; Keywords
|
||||
|
||||
[
|
||||
|
|
@ -31,13 +35,16 @@
|
|||
;; Function related
|
||||
(function_declaration name: (_) @function)
|
||||
(call_expression function: (identifier) @function)
|
||||
(function_declaration parameters: (parameters (identifier) @parameter))
|
||||
|
||||
[ (bang) (spread) ] @punctuation.special
|
||||
|
||||
[ (no_option) (inv_option) (default_option) (option_name) ] @variable.builtin
|
||||
[ (scope) "a:" ] @namespace
|
||||
|
||||
(ternary_expression ["?" ":"] @conditional)
|
||||
[
|
||||
(scope)
|
||||
"a:"
|
||||
"$"
|
||||
] @namespace
|
||||
|
||||
;; Commands and user defined commands
|
||||
|
||||
|
|
@ -83,12 +90,17 @@
|
|||
(float_literal) @float
|
||||
(comment) @comment
|
||||
(pattern) @string.special
|
||||
((scoped_identifier
|
||||
(scope) @_scope . (identifier) @boolean)
|
||||
(#eq? @_scope "v:")
|
||||
(#any-of? @boolean "true" "false"))
|
||||
|
||||
;; Operators
|
||||
|
||||
[
|
||||
"||"
|
||||
"&&"
|
||||
"&"
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
|
|
@ -130,4 +142,14 @@
|
|||
] @punctuation.bracket
|
||||
|
||||
(field_expression "." @punctuation.delimiter)
|
||||
"," @punctuation.delimiter
|
||||
|
||||
[
|
||||
","
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
||||
(ternary_expression ["?" ":"] @conditional)
|
||||
|
||||
; Options
|
||||
((set_value) @number
|
||||
(#match? @number "^[0-9]+(\.[0-9]+)?$"))
|
||||
|
|
|
|||
10
queries/vim/locals.scm
Normal file
10
queries/vim/locals.scm
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[
|
||||
(script_file)
|
||||
(function_definition)
|
||||
] @scope
|
||||
|
||||
(function_declaration name: (identifier) @definition.function)
|
||||
(function_declaration parameters: (parameters (identifier) @definition.parameter))
|
||||
(let_statement [(scoped_identifier) (identifier)] @definition.var)
|
||||
|
||||
(identifier) @reference
|
||||
Loading…
Add table
Add a link
Reference in a new issue