nvim: try setting up helm templating
This commit is contained in:
@ -31,6 +31,9 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
lsp.helm_ls.setup({
|
||||||
|
filetypes= { "helm", "yaml" },
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,15 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
config = function()
|
config = function()
|
||||||
|
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||||
|
parser_config.gotmpl = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/ngalaiko/tree-sitter-go-template",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
},
|
||||||
|
filetype = "gotmpl",
|
||||||
|
used_by = { "gohtmltmpl", "gotexttmpl", "gotmpl", "yaml" },
|
||||||
|
}
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|||||||
84
.config/nvim/queries/gotmpl/highlights.scm
Normal file
84
.config/nvim/queries/gotmpl/highlights.scm
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
; 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
|
||||||
|
|
||||||
|
(escape_sequence) @string.special
|
||||||
|
|
||||||
|
[
|
||||||
|
(int_literal)
|
||||||
|
(float_literal)
|
||||||
|
(imaginary_literal)
|
||||||
|
] @number
|
||||||
|
|
||||||
|
[
|
||||||
|
(true)
|
||||||
|
(false)
|
||||||
|
] @boolean
|
||||||
|
|
||||||
|
[
|
||||||
|
(nil)
|
||||||
|
] @constant.builtin
|
||||||
|
|
||||||
|
(comment) @comment
|
||||||
|
(ERROR) @error
|
||||||
1
.config/nvim/queries/gotmpl/injections.scm
Normal file
1
.config/nvim/queries/gotmpl/injections.scm
Normal file
@ -0,0 +1 @@
|
|||||||
|
(text) @yaml
|
||||||
Reference in New Issue
Block a user