843d1ca3a1
Signed-off-by: Timothy Pidashev <mail@timmypidashev.dev>
18 lines
474 B
Lua
18 lines
474 B
Lua
local langs = require("timmypidashev.langs")
|
|
|
|
require("nvim-treesitter").install(langs)
|
|
|
|
vim.filetype.add({
|
|
extension = { templ = "templ" },
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd("FileType", {
|
|
callback = function(args)
|
|
local ft = vim.bo[args.buf].filetype
|
|
local lang = vim.treesitter.language.get_lang(ft) or ft
|
|
if pcall(vim.treesitter.start, args.buf, lang) then
|
|
vim.bo[args.buf].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
|
end
|
|
end,
|
|
})
|