added treesitter auto install

This commit is contained in:
2026-04-24 08:36:07 +02:00
parent be4fd8426c
commit d00a72615a
+7 -1
View File
@@ -65,7 +65,13 @@ require("nvim-treesitter").install({
})
vim.api.nvim_create_autocmd("FileType", {
callback = function() pcall(vim.treesitter.start) end,
callback = function()
local lang = vim.treesitter.language.get_lang(vim.bo.filetype)
if lang and not pcall(vim.treesitter.language.inspect, lang) then
require("nvim-treesitter").install(lang)
end
pcall(vim.treesitter.start)
end,
})
-- TS textobjects