BREAKING CHANGE: Migrate to nvim-treesitter main branch #3295

Users must now use the :TSInstallAll command to install all treesitter parsers defined in their config. So there's no automatic downloading of treesitter parsers like before

tree-sitter-cli is a required dependency now

---------

Co-authored-by: siduck <siduck@tutanota.com>
This commit is contained in:
Nick Krichevsky
2026-01-17 23:02:48 +05:30
committed by GitHub
co-authored by siduck
parent 30e75dbbdf
commit 6a0715d3f3
3 changed files with 16 additions and 12 deletions
+15
View File
@@ -25,3 +25,18 @@ autocmd({ "UIEnter", "BufReadPost", "BufNewFile" }, {
end
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "*",
callback = function()
pcall(vim.treesitter.start)
end,
})
local create_cmd = vim.api.nvim_create_user_command
create_cmd("TSInstallAll", function()
local spec = require("lazy.core.config").plugins["nvim-treesitter"]
local opts = type(spec.opts) == "table" and spec.opts or {}
require("nvim-treesitter").install(opts.ensure_installed)
end, {})