mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat: lazy setup with either a plugins module, or a plugins spec
This commit is contained in:
parent
f0894be69d
commit
af8b8e128e
8 changed files with 54 additions and 53 deletions
|
@ -1,7 +1,8 @@
|
|||
local M = {}
|
||||
|
||||
---@param spec LazySpec Should be a module name to load, or a plugin spec
|
||||
---@param opts? LazyConfig
|
||||
function M.setup(opts)
|
||||
function M.setup(spec, opts)
|
||||
local module_start = vim.loop.hrtime()
|
||||
require("lazy.core.module").setup()
|
||||
local Util = require("lazy.core.util")
|
||||
|
@ -14,23 +15,11 @@ function M.setup(opts)
|
|||
Util.track("setup")
|
||||
|
||||
Util.track("config")
|
||||
Config.setup(opts)
|
||||
Config.setup(spec, opts)
|
||||
Util.track()
|
||||
|
||||
Plugin.load()
|
||||
|
||||
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 })
|
||||
break
|
||||
end
|
||||
end
|
||||
Util.track()
|
||||
end
|
||||
|
||||
Util.track("loader")
|
||||
Loader.setup()
|
||||
Util.track()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue