feat: add treesitter highlighting for gotmpl
Add detection, treesitter highlighting, and tab spacing settings for gotmpl files.
This commit is contained in:
parent
fa2e934d15
commit
746f07efdb
4 changed files with 14 additions and 0 deletions
7
nvim/after/ftplugin/gotmpl.lua
Normal file
7
nvim/after/ftplugin/gotmpl.lua
Normal 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
|
4
nvim/lua/ftdetect/gotmpl.lua
Normal file
4
nvim/lua/ftdetect/gotmpl.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
vim.api.nvim_create_autocmd(
|
||||
{ "BufNewFile", "BufRead"},
|
||||
{ pattern = {"*.gotmpl"}, command = "set ft=gotmpl" }
|
||||
)
|
|
@ -1 +1,2 @@
|
|||
require("ftdetect.jsonnet")
|
||||
require("ftdetect.gotmpl")
|
||||
|
|
|
@ -9,6 +9,8 @@ treesitter.setup {
|
|||
"bash",
|
||||
"go",
|
||||
"gomod",
|
||||
"gosum",
|
||||
"gotmpl",
|
||||
"hcl",
|
||||
"json",
|
||||
"lua",
|
||||
|
|
Loading…
Reference in a new issue