{"repo":"ngalaiko/tree-sitter-go-template","free":true,"listed":false,"github":"https://github.com/ngalaiko/tree-sitter-go-template","clone":"git clone https://github.com/ngalaiko/tree-sitter-go-template.git","description":"Golang template grammar for tree-sitter","language":"JavaScript","stars":140,"topics":["tree-sitter","parser","go","template"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"Announcement The original author stopped using helm (which he mostly wrote this package for) on a daily basis, so he didn't really keep up with the development of tree sitter, and nvim-tree-sitter. Some people have been found to keep the repo going, so if you have ideas for improvements feel free to open issues or pull requests. tree-sitter-go-template [Golang templates][] grammar for [tree-sitter][]. Also includes a [helm][] dialect. The concept of a dialect is that it uses the same parser, but can have different queries (e.g. for different injections). More dialects could be added in the future (e.g. for html templates). NeoVim integration using [nvim-treesitter][] - Setup filetype detection: - using lua: - Install [nvim-treesitter][] as described here: [nvim-treesitter-install][] - Install the parser you want to use: Highlighting for the templated language To get proper highlighting for the language that is templated (e.g. html) you need to add injections for that language to .config/nvim/queries/gotmpl/injections.scm : Replace html with the tree-sitter name of your required language and make sure to install it with :TSInstall . More advanced use cases would require adding more dialects (as done for helm). [!NOTE] If you are using helm, you should also install the yaml parser (:TSInstall yaml) to get [language injection][] for yaml. In case you are using [AstroNvim][] you can just install the [astrocommunity][] helm pack or when using [LazyVim][] its [LazyVimHelm] plugin. ","default_branch":null,"files":null,"tree":[],"storefront":"/r/ngalaiko","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ngalaiko/tree-sitter-go-template/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}