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",
|
"git_config",
|
||||||
},
|
},
|
||||||
|
|
||||||
auto_install = true,
|
|
||||||
|
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
additional_vim_regex_highlighting = false,
|
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 = {
|
indent = {
|
||||||
enable = true
|
enable = true
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user