删除treesitter预设

This commit is contained in:
QQ 2023-04-03 19:41:42 +08:00
parent 3e318b17e8
commit c9245a9d51

View File

@ -1,7 +1,7 @@
local G = require("G") local G = require("G")
require'nvim-treesitter.configs'.setup { require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the four listed parsers should always be installed) -- A list of parser names, or "all" (the four listed parsers should always be installed)
ensure_installed = { "javascript", "typescript", "html", "css", "vue", "c", "lua", "vim", "help"}, ensure_installed = {},
indent = { enable = true }, indent = { enable = true },
-- Install parsers synchronously (only applied to `ensure_installed`) -- Install parsers synchronously (only applied to `ensure_installed`)
@ -29,7 +29,7 @@ require'nvim-treesitter.configs'.setup {
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
disable = function(lang, buf) disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, G.api.nvim_buf_get_name(buf)) local ok, stats = pcall(G.loop.fs_stat, G.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then if ok and stats and stats.size > max_filesize then
return true return true
end end