neovim: migrate to nvim-treesitter main branch

This commit is contained in:
2026-03-28 15:52:28 +03:00
parent aa2ffbe839
commit f977aa5796
3 changed files with 46 additions and 33 deletions

View File

@@ -1,35 +1,48 @@
require("nvim-treesitter.configs").setup({
ensure_installed = {
"bash",
"c",
"cmake",
"comment",
"css",
"dockerfile",
"go",
"gomod",
"html",
"javascript",
"jsdoc",
"json",
"jsonc",
"lua",
"make",
"markdown",
"python",
"rust",
"scss",
"svelte",
"tsx",
"typescript",
"vim",
"yaml",
},
highlight = {
enable = true,
},
local languages = {
"bash",
"c",
"cmake",
"comment",
"css",
"dockerfile",
"go",
"gomod",
"html",
"javascript",
"jsdoc",
"json",
"lua",
"make",
"markdown",
"python",
"rust",
"scss",
"svelte",
"tsx",
"typescript",
"vim",
"yaml",
}
require("nvim-treesitter").setup({
install_dir = vim.fn.stdpath("data") .. "/site",
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { "*" },
callback = function()
pcall(vim.treesitter.start)
end,
})
vim.api.nvim_create_user_command("NvimTSInstall", function()
require("nvim-treesitter").install(languages)
end, {})
vim.api.nvim_create_user_command("NvimTSUpdate", function()
require("nvim-treesitter").update(languages)
end, {})
require("nvim-ts-autotag").setup({
opts = {
enable_close = true,