return { 'nvim-treesitter/nvim-treesitter', lazy = false, build = ':TSUpdate', config = function() -- Auto launch tree-sitter local ts = require('nvim-treesitter') vim.api.nvim_create_autocmd('FileType', { pattern = ts.get_available(), callback = function(event) -- Auto install languages if event.match ~= ts.get_installed() then ts.install({ event.match }):wait(30000) -- 30 sec timeout end -- syntax highlighting, provided by Neovim vim.treesitter.start() -- Use regex highlighting as well as tree-sitter vim.bo.syntax = event.match -- folds, provided by Neovim vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' vim.wo.foldmethod = 'expr' -- indentation, provided by nvim-treesitter vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end, }) end }