diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua index 920da0a..0da8934 100644 --- a/.config/nvim/lua/config/lazy.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -18,38 +18,6 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) -local function disable_plugins_for_large_files() - local max_filesize = 1024 * 1024 -- 1 MB - local filepath = vim.fn.expand("%:p") - local filesize = vim.fn.getfsize(filepath) - - if filesize <= max_filesize then - return - end - - -- Disable treesitter - local filetype = vim.bo.filetype - if filetype ~= "" then - vim.cmd("TSBufDisable " .. filetype) - end - - -- Disable nvim-cmp - local cmp = require("cmp") - if cmp then - cmp.setup.buffer({ enabled = false }) - end - - vim.api.nvim_echo({ - { "Plugins disabled for large file: " .. filepath, "WarningMsg" }, - }, false, {}) -end - --- Autocmd to check file size on BufRead -vim.api.nvim_create_autocmd("BufRead", { - callback = disable_plugins_for_large_files, - desc = "Disable heavy plugins for large files", -}) - require("lazy").setup({ root = lazy_home, spec = {