From d00a72615a4814311f84b2206e2433683bbf7c5d Mon Sep 17 00:00:00 2001 From: Jannik Donker Date: Fri, 24 Apr 2026 08:36:07 +0200 Subject: [PATCH] added treesitter auto install --- lua/plugins.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index 8fd2748..c408050 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -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