return { { 'nvim-treesitter/nvim-treesitter', branch = 'main', lazy = false, build = ':TSUpdate', config = function(_, opts) -- enable indent vim.api.nvim_create_autocmd('FileType', { callback = function() pcall(vim.treesitter.start) vim.bo.indentexpr = [[v:lua.require'nvim-treesitter'.indentexpr()]] end, }) -- auto-install local already_installed = require('nvim-treesitter').get_installed() local parsers_installable = vim .iter(opts.ensure_installed) :filter(function(parser) return not vim.tbl_contains(already_installed, parser) end) :totable() require('nvim-treesitter').install(parsers_installable) end, opts = { ensure_installed = { 'bash', 'c', 'cmake', 'comment', 'cpp', 'css', 'dockerfile', 'go', 'gomod', 'gotmpl', 'gowork', 'html', 'javascript', 'json', 'lua', 'make', 'markdown', 'markdown_inline', 'ninja', 'python', 'regex', 'rust', 'scss', 'sql', 'todotxt', 'toml', 'typescript', 'typst', 'vim', 'vimdoc', 'yaml', 'zig', }, }, }, }