return { "nvim-treesitter/nvim-treesitter", event = { "BufReadPre", "BufNewFile" }, build = ":TSUpdate", dependencies = { "windwp/nvim-ts-autotag", }, config = function() local treesitter = require("nvim-treesitter.configs") treesitter.setup({ modules = {}, ignore_install = { "" }, sync_install = false, highlight = { enable = true, }, indent = { enable = true, }, autotag = { -- With nvim-ts-autotag plugin enable = true, }, --[[ rainbow = { enable = true, extended_mode = true, max_file_lines = nil, }, --]] ensure_installed = { "rust", "go", "python", "ocaml", "json", "javascript", "typescript", "tsx", "yaml", "css", "lua", -- "mchat", -- { "mchat", "gsuuon/tree-sitter-mchat" }, "toml", }, auto_install = true, incremental_selection = { enable = true, keymaps = { init_selection = "", node_incremental = "", scope_incremental = false, node_decremental = "", }, }, }) -- local parser_config = require("nvim-treesitter.parsers").get_parser_configs() -- parser_config.mchat = { -- install_info = { -- url = "~/.config/nvim/tree-sitter-mchat", -- local path or git repo -- files = { "src/parser.c" }, -- note that some parsers also require src/scanner.c or src/scanner.cc -- -- optional entries: -- branch = "main", -- default branch in case of git repo if different from master -- generate_requires_npm = false, -- if stand-alone parser without npm dependencies -- requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c -- }, -- -- filetype = "zu", -- if filetype does not match the parser name -- } vim.wo.foldmethod = "expr" vim.wo.foldexpr = "nvim_treesitter#foldexpr()" vim.wo.foldlevel = 9 end, }