return { { "neovim-treesitter/nvim-treesitter", lazy = false, dependencies = "AstroNvim/astrocore", branch = "main", main = "nvim-treesitter", opts = function(_, opts) -- add more things to the ensure_installed table protecting against community packs modifying it opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "lua", "cpp", "c", "bash", "vim", "markdown", "asm", "cmake", "css", "html", "javascript", "printf", "fish", "git_config", "git_rebase", "gitcommit", "gitignore", "gitattributes", "java", "meson", "ninja", "python", "sql", "typescript", "vimdoc", "xml" }) end, config = function() require("nvim-treesitter.configs").setup { highlight = { enable = true, additional_vim_regex_highlighting = false }, ensure_installed = { "lua", "cpp", "c", "bash", "vim", "markdown", "asm", "cmake", "css", "html", "javascript", "printf", "fish", "git_config", "git_rebase", "gitcommit", "gitignore", "gitattributes", "java", "meson", "ninja", "python", "sql", "typescript", "vimdoc", "xml" } } end }, -- init = function() -- vim.api.nvim_create_autocmd('FileType', { -- callback = function() -- -- Enable treesitter highlighting and disable regex syntax -- pcall(vim.treesitter.start) -- -- Enable treesitter-based indentation -- vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" -- end, -- } -- ) -- local ensureInstalled = { -- "lua", -- "cpp", -- "c", -- "bash", -- "vim", -- "markdown", -- "asm", -- "cmake", -- "css", -- "html", -- "javascript", -- "printf", -- "fish", -- "git_config", -- "git_rebase", -- "gitcommit", -- "gitignore", -- "gitattributes", -- "java", -- "meson", -- "ninja", -- "python", -- "sql", -- "typescript", -- "vimdoc", -- "xml" -- -- ... your parsers -- } -- local alreadyInstalled = require('nvim-treesitter.config').get_installed() -- local parsersToInstall = vim.iter(ensureInstalled) -- :filter(function(parser) -- return not vim.tbl_contains(alreadyInstalled, parser) -- end) -- :totable() -- require('nvim-treesitter').install(parsersToInstall) -- end, }