local M = { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", event = "BufReadPost", dependencies = { "nvim-treesitter/nvim-treesitter-context", }, opts = { highlight = { enable = true, use_languagetree = true, disable = function(lang, buf) local max_filesize = 100 * 1024 -- 100 KB local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) if ok and stats and stats.size > max_filesize then return true end end, }, autopairs = { enable = true }, autotag = { enable = true }, indent = { enable = true }, ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc", "markdown", "markdown_inline", }, sync_install = true, auto_install = true, ignore_install = {}, }, config = function(_, opts) require("nvim-treesitter.configs").setup(opts) require("treesitter-context").setup({ enable = true, max_lines = 3 }) end, } return M