feat: add treesitter highlighting for gotmpl

Add detection, treesitter highlighting, and tab spacing settings for
gotmpl files.
This commit is contained in:
Dan Anglin 2024-08-21 18:39:42 +01:00
parent fa2e934d15
commit 746f07efdb
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
4 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,7 @@
local setlocal = vim.opt_local
-- Tabs and spaces
setlocal.expandtab = false
setlocal.tabstop = 8
setlocal.shiftwidth = 8
setlocal.softtabstop = 8

View file

@ -0,0 +1,4 @@
vim.api.nvim_create_autocmd(
{ "BufNewFile", "BufRead"},
{ pattern = {"*.gotmpl"}, command = "set ft=gotmpl" }
)

View file

@ -1 +1,2 @@
require("ftdetect.jsonnet")
require("ftdetect.gotmpl")

View file

@ -9,6 +9,8 @@ treesitter.setup {
"bash",
"go",
"gomod",
"gosum",
"gotmpl",
"hcl",
"json",
"lua",