From bc842c8659ceceb77ca02928e6d503264e95c4ea Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 22 May 2023 17:55:47 -0500 Subject: [PATCH] feat(nvim): provide capability to disable ts highlights for filetypes --- dots/.config/nvim/lua/plugins/configs/treesitter.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dots/.config/nvim/lua/plugins/configs/treesitter.lua b/dots/.config/nvim/lua/plugins/configs/treesitter.lua index 26fddd30..d979cacb 100755 --- a/dots/.config/nvim/lua/plugins/configs/treesitter.lua +++ b/dots/.config/nvim/lua/plugins/configs/treesitter.lua @@ -10,6 +10,16 @@ nvim_treesitter.setup({ highlight = { enable = true, disable = function(_, buf) + local disabled_filetypes = { + "tex", + } + + for _, ft in ipairs(disabled_filetypes) do + if vim.bo.filetype == ft then + return true + end + end + 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