diff --git a/nvim/.config/nvim/lua/core/lazy.lua b/nvim/.config/nvim/lua/core/lazy.lua index f57bf7b..ddb750b 100644 --- a/nvim/.config/nvim/lua/core/lazy.lua +++ b/nvim/.config/nvim/lua/core/lazy.lua @@ -31,8 +31,13 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) +-- ensure plugins specs exist before loading into lazy +local spec_dir = vim.fn.stdpath("config") .. "/lua/plugins" +local spec_exist = (vim.fn.isdirectory(spec_dir) ~= 0) and (#vim.fn.glob(spec_dir .. "/*.lua", nil, true) ~= 0) +local spec = spec_exist and { import = "plugins" } or {} + require("lazy").setup({ - spec = { { import = "plugins" } }, + spec = { spec }, defaults = { lazy = true, version = "*" }, performance = { rtp = { disabled_plugins = { "netrw", "netrwPlugin" } },