make treesitter disable on massive files, and diff files
also remove auto installing
This commit is contained in:
parent
1af19150f9
commit
a80bb9a592
1 changed files with 9 additions and 3 deletions
|
|
@ -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
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue