-- -- Treesitter parsers -- require("nvim-treesitter").install({ "bash", "diff", "gitcommit", "git_rebase", "ini", "json", "lua", "python", "readline", "vim", "vimdoc", }) -- Parse the tree as early as possible, which is as soon as we know the filetype -- -- Event handlers for the same event are triggered in the order they were created. This must be the first FileType -- handler created so that the tree is parsed for other FileType handlers (which often need the parsed tree). To create -- it first put this in a file that comes before alphabetically in the `plugin/` directory. vim.api.nvim_create_autocmd("FileType", { desc = "Start treesitter", group = vim.g.dotfiles.augroup, callback = function() local parser = vim.treesitter.get_parser(0) if parser == nil then return end parser:parse() -- Parse once asynchronously; used by logic that needs the parsed tree (like extmarks) vim.treesitter.start() end, })