From 9be3d3d8409c6992cea5b2ffe0973fd6b4895dc6 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 29 Nov 2022 23:16:57 +0100 Subject: [PATCH] feat: config option install_missing=true --- lua/lazy/init.lua | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lua/lazy/init.lua b/lua/lazy/init.lua index 5d942c8..06fa663 100644 --- a/lua/lazy/init.lua +++ b/lua/lazy/init.lua @@ -25,25 +25,25 @@ function M.setup(opts) Plugin.load() Util.track() - Util.track("install") - for _, plugin in pairs(Config.plugins) do - if not plugin._.installed then - vim.cmd("do User LazyInstallPre") - require("lazy.manage").install({ - wait = true, - show = Config.options.interactive, - }) - break + if Config.options.install_missing then + Util.track("install") + for _, plugin in pairs(Config.plugins) do + if not plugin._.installed then + vim.cmd("do User LazyInstallPre") + require("lazy.manage").install({ + wait = true, + show = Config.options.interactive, + }) + break + end end + Util.track() end - Util.track() Util.track("loader") Loader.setup() Util.track() - Util.track() -- end setup - local lazy_delta = vim.loop.hrtime() - cache_start Loader.init_plugins() @@ -53,6 +53,7 @@ function M.setup(opts) end vim.cmd("do User LazyDone") + Util.track() -- end setup end function M.stats()