vim.pack.add({ { src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "master" } }) local configs = require("nvim-treesitter.configs") configs.setup({ ensure_installed = { "bash", "blade", "c", "comment", "css", "diff", "dockerfile", "fish", "gitcommit", "gitignore", "go", "gomod", "gosum", "gowork", "html", "ini", "javascript", "jsdoc", "json", "lua", "luadoc", "luap", "make", "markdown", "markdown_inline", "nginx", "nix", "proto", "python", "query", "regex", "rust", "scss", "sql", "toml", "tsx", "typescript", "vim", "vimdoc", "xml", "yaml", "zig", }, auto_install = true, sync_install = true, highlight = { enable = true }, indent = { enable = true }, incremental_selection = { enable = true, keymaps = { init_selection = "", scope_incremental = "", node_incremental = "", node_decremental = "", }, }, }) vim.api.nvim_create_autocmd("PackChanged", { desc = "Handle nvim-treesitter updates", group = vim.api.nvim_create_augroup("nvim-treesitter-pack-changed-update-handler", { clear = true }), callback = function(event) if event.data.kind == "update" then local ok = pcall(vim.cmd, "TSUpdate") if ok then vim.notify("TSUpdate completed successfully!", vim.log.levels.INFO) else vim.notify("TSUpdate command not available yet, skipping", vim.log.levels.WARN) end end end, })