diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/treesitter.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/treesitter.lua index 47e5ff9f..d1b5de09 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/treesitter.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/treesitter.lua @@ -6,6 +6,13 @@ nvim_treesitter.setup({ }, highlight = { enable = true, + disable = function(_, 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, }, matchup = { enable = true,