config(nvim): disable treesitter on big files

main
sudo pacman -Syu 2024-01-17 02:00:24 +07:00
parent 64854ebdfa
commit a5228ce159
1 changed files with 12 additions and 0 deletions

View File

@ -390,6 +390,18 @@ require("lazy").setup({
"go",
"proto",
},
highlight = {
enabled = true,
disable = function(lang, bufnr)
-- Skip if not go, proto
if lang ~= "go" and lang ~= "proto" then
return true
end
-- Skip big files with many lines
return vim.api.nvim_buf_line_count(bufnr) > 2000
end,
},
})
end,
},