feat(nvim): disable treesitter on large files (>100KB)
This commit is contained in:
parent
2e498f2aef
commit
7d012db9e8
@ -6,6 +6,13 @@ nvim_treesitter.setup({
|
|||||||
},
|
},
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
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 = {
|
matchup = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user