Regenerate nvim config
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
[
|
||||
(ast_block)
|
||||
(list)
|
||||
(array)
|
||||
(expr)
|
||||
(json_array)
|
||||
(json_object)
|
||||
(parenthesized_expression)
|
||||
] @fold
|
||||
@ -0,0 +1,154 @@
|
||||
; Tags
|
||||
; TODO apply to every symbol in list? I think it should probably only be applied to the first child of the list
|
||||
(list
|
||||
(symbol) @tag)
|
||||
|
||||
; Includes
|
||||
(list
|
||||
.
|
||||
(symbol) @keyword.import
|
||||
(#eq? @keyword.import "include"))
|
||||
|
||||
; Keywords
|
||||
(list
|
||||
.
|
||||
(symbol) @keyword
|
||||
(#any-of? @keyword
|
||||
"defwindow" "defwidget" "defvar" "defpoll" "deflisten" "geometry" "children" "struts"))
|
||||
|
||||
; Loop
|
||||
(loop_widget
|
||||
.
|
||||
"for" @keyword.repeat
|
||||
.
|
||||
(symbol) @variable
|
||||
.
|
||||
"in" @keyword.operator)
|
||||
|
||||
(loop_widget
|
||||
.
|
||||
"for" @keyword.repeat
|
||||
.
|
||||
(symbol) @variable
|
||||
.
|
||||
"in" @keyword.operator
|
||||
.
|
||||
(symbol) @variable)
|
||||
|
||||
; Builtin widgets
|
||||
(list
|
||||
.
|
||||
(symbol) @tag.builtin
|
||||
(#any-of? @tag.builtin
|
||||
"box" "button" "calendar" "centerbox" "checkbox" "circular-progress" "color-button"
|
||||
"color-chooser" "combo-box-text" "eventbox" "expander" "graph" "image" "input" "label" "literal"
|
||||
"overlay" "progress" "revealer" "scale" "scroll" "transform"))
|
||||
|
||||
; Variables
|
||||
(ident) @variable
|
||||
|
||||
(array
|
||||
(symbol) @variable)
|
||||
|
||||
((ident) @variable.builtin
|
||||
(#any-of? @variable.builtin
|
||||
"EWW_TEMPS" "EWW_RAM" "EWW_DISK" "EWW_BATTERY" "EWW_CPU" "EWW_NET" "EWW_TIME" "EWW_CONFIG_DIR"
|
||||
"EWW_CMD" "EWW_EXECUTABLE"))
|
||||
|
||||
; Properties
|
||||
(keyword) @property
|
||||
|
||||
(json_access
|
||||
(_)
|
||||
"["
|
||||
(simplexpr
|
||||
(ident) @property))
|
||||
|
||||
(json_safe_access
|
||||
(_)
|
||||
"?."
|
||||
"["
|
||||
(simplexpr
|
||||
(ident) @property))
|
||||
|
||||
(json_dot_access
|
||||
(index) @property)
|
||||
|
||||
(json_safe_dot_access
|
||||
(index) @property)
|
||||
|
||||
(json_object
|
||||
(simplexpr
|
||||
(ident) @property))
|
||||
|
||||
; Functions
|
||||
(function_call
|
||||
name: (ident) @function.call)
|
||||
|
||||
; Operators
|
||||
[
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
"%"
|
||||
"||"
|
||||
"&&"
|
||||
"=="
|
||||
"!="
|
||||
"=~"
|
||||
">"
|
||||
"<"
|
||||
">="
|
||||
"<="
|
||||
"!"
|
||||
"?."
|
||||
"?:"
|
||||
] @operator
|
||||
|
||||
; Punctuation
|
||||
[
|
||||
":"
|
||||
"."
|
||||
","
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"{"
|
||||
"}"
|
||||
"["
|
||||
"]"
|
||||
"("
|
||||
")"
|
||||
] @punctuation.bracket
|
||||
|
||||
; Ternary expression
|
||||
(ternary_expression
|
||||
[
|
||||
"?"
|
||||
":"
|
||||
] @keyword.conditional.ternary)
|
||||
|
||||
; Literals
|
||||
(number) @number
|
||||
|
||||
(float) @number.float
|
||||
|
||||
(boolean) @boolean
|
||||
|
||||
; Strings
|
||||
[
|
||||
(string_fragment)
|
||||
"\""
|
||||
"'"
|
||||
"`"
|
||||
] @string
|
||||
|
||||
(string_interpolation
|
||||
"${" @punctuation.special
|
||||
"}" @punctuation.special)
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
; Comments
|
||||
(comment) @comment @spell
|
||||
@ -0,0 +1,30 @@
|
||||
[
|
||||
(ast_block)
|
||||
(array)
|
||||
(expr)
|
||||
(json_array)
|
||||
(json_object)
|
||||
(parenthesized_expression)
|
||||
] @indent.begin
|
||||
|
||||
; TODO: can't get this to work, goal is to indent at the property ":" prefix
|
||||
; ((list (identifier) (property)) @indent.align
|
||||
; (#set! indent.open_delimiter "(")
|
||||
; (#set! indent.close_delimiter ")"))
|
||||
[
|
||||
")"
|
||||
"}"
|
||||
"]"
|
||||
] @indent.end @indent.branch
|
||||
|
||||
; I do not know what/when this should be added.
|
||||
; Commenting this out for now
|
||||
; [
|
||||
; "("
|
||||
; "{"
|
||||
; "["
|
||||
; ] @indent.branch
|
||||
[
|
||||
(ERROR)
|
||||
(comment)
|
||||
] @indent.auto
|
||||
@ -0,0 +1,26 @@
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((function_call
|
||||
name: (ident) @_name
|
||||
.
|
||||
(simplexpr)
|
||||
.
|
||||
(simplexpr
|
||||
(string
|
||||
(string_fragment) @injection.content)+))
|
||||
(#any-of? @_name "replace" "search" "matches" "captures")
|
||||
(#set! injection.language "regex")
|
||||
(#set! injection.combined))
|
||||
|
||||
((function_call
|
||||
name: (ident) @_name
|
||||
.
|
||||
(simplexpr)
|
||||
.
|
||||
(simplexpr
|
||||
(string
|
||||
(string_fragment) @injection.content)+))
|
||||
(#eq? @_name "jq")
|
||||
(#set! injection.language "jq")
|
||||
(#set! injection.combined))
|
||||
@ -0,0 +1,21 @@
|
||||
[
|
||||
(ast_block)
|
||||
(list)
|
||||
(array)
|
||||
(expr)
|
||||
(json_array)
|
||||
(json_object)
|
||||
(parenthesized_expression)
|
||||
] @local.scope
|
||||
|
||||
(symbol) @local.reference
|
||||
|
||||
(keyword) @local.definition.field
|
||||
|
||||
(json_object
|
||||
(simplexpr
|
||||
(ident) @local.definition.field))
|
||||
|
||||
(ast_block
|
||||
(symbol)
|
||||
(ident) @local.definition.type)
|
||||
Reference in New Issue
Block a user