make treesitter disable on massive files, and diff files
also remove auto installing
This commit is contained in:
@ -18,13 +18,19 @@ treesitter.setup {
|
||||
"git_config",
|
||||
},
|
||||
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
disable = function(lang, buf)
|
||||
if lang == "diff" then return true end
|
||||
local max_filesize = 1024 * 100 -- 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
|
||||
},
|
||||
indent = {
|
||||
enable = true
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user