all repos

init.lua @ d802bac9605ad3b2e87b62a7516440850ba4bf8b

my nvim config
3 files changed, 69 insertions(+), 0 deletions(-)
feat(treesitter): now in go files sql and json are highlighted
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2023-07-23 01:17:10 +0300
Parent: 3713a0c
A queries/go/injections.scm

@@ -0,0 +1,19 @@

+;; sql +([(interpreted_string_literal) + (raw_string_literal)] @sql + (#contains? @sql + "--sql" "-- sql" "select" "insert" "update" "delete" "from" "into" "values" "set" "where" "group by" + "--SQL" "-- SQL" "SELECT" "INSERT" "UPDATE" "DELETE" "FROM" "INTO" "VALUES" "SET" "WHERE" "GROUP BY") + (#offset! @sql 0 1 0 -1)) + +;; json +((const_spec + name: (identifier) @_const + value: (expression_list (raw_string_literal) @json)) + (#lua-match? @_const ".*[J|j]son.*")) + +((short_var_declaration + left: (expression_list (identifier) @_var) + right: (expression_list (raw_string_literal) @json)) + (#lua-match? @_var ".*[J|j]son.*") + (#offset! @json 0 1 0 -1))
A queries/gotmpl/highlights.scm

@@ -0,0 +1,49 @@

+; Identifiers +[(field) (field_identifier)] @property +(variable) @variable + +; Function calls +(function_call + function: (identifier) @function) + +(method_call + method: (selector_expression + field: (field_identifier) @method)) + +; Operators +"|" @operator +":=" @operator + +; Builtin functions +((identifier) @function.builtin + (#match? @function.builtin "^(and|call|html|index|slice|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|ge|gt|ge)$")) + +; Delimiters +"." @punctuation.delimiter +"," @punctuation.delimiter +"{{" @punctuation.bracket +"}}" @punctuation.bracket +"{{-" @punctuation.bracket +"-}}" @punctuation.bracket +")" @punctuation.bracket +"(" @punctuation.bracket + +; Keywords +["else" "else if" "if" "with"] @conditional +["range" "end" "template" "define" "block"] @keyword + +; Literals +[(interpreted_string_literal) + (raw_string_literal) + (rune_literal)] @string + +[(int_literal) + (float_literal) + (imaginary_literal)] @number + +[(true) (false)] @boolean +[(nil)] @constant.builtin + +(escape_sequence) @string.special +(comment) @comment +(ERROR) @error
A queries/gotmpl/injections.scm

@@ -0,0 +1,1 @@

+(text) @html