This commit is contained in:
2026-01-25 00:42:10 +03:00
commit c93fed704b
22 changed files with 1396 additions and 0 deletions

View File

@ -0,0 +1,31 @@
-- lua/config/nvim-treesitter.lua
require('nvim-treesitter').setup({
highlight = {
enable = true,
disable = function(lang, buf)
-- Проверяем, существует ли буфер и связан ли он с файлом
if not buf or buf == 0 then
return true
end
-- Получаем информацию о файле
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if not ok or not stats or not stats.size then
return true
end
-- Отключаем подсветку для больших файлов
local max_filesize = 500 * 1024 -- 500 KB
if stats.size > max_filesize then
return true
end
-- Включаем подсветку для всех остальных случаев
return false
end,
},
-- Дополнительно можно включить другие функции:
-- indent = { enable = true },
-- incremental_selection = { enable = true },
-- textobjects = { ... },
})