From 332716c04734a4f8afc273f9bee9f3fc3c7c2402 Mon Sep 17 00:00:00 2001 From: Aotrix Date: Sun, 23 Feb 2025 03:46:30 +0100 Subject: enabled treesitter for C++ --- lua/aotrix/plugins/treesitter.lua | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lua/aotrix/plugins/treesitter.lua b/lua/aotrix/plugins/treesitter.lua index 09dc61c..7891b2c 100644 --- a/lua/aotrix/plugins/treesitter.lua +++ b/lua/aotrix/plugins/treesitter.lua @@ -26,15 +26,14 @@ return { -- the name of the parser) -- list of language that will be disabled -- disable = { "c", "rust" }, - disable = { "cpp" }, -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files - -- 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, + 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, -- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- cgit v1.2.3