mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-19 04:46:45 +00:00
perf: tons of performance improvements. Lazy should now load in about 1.5ms for 97 plugins
This commit is contained in:
parent
711834f17c
commit
2507fd5790
11 changed files with 220 additions and 278 deletions
|
@ -8,6 +8,7 @@ M.defaults = {
|
|||
plugins = "config.plugins",
|
||||
plugins_local = {
|
||||
path = vim.fn.expand("~/projects"),
|
||||
---@type string[]
|
||||
patterns = {},
|
||||
},
|
||||
package_path = vim.fn.stdpath("data") .. "/site/pack/lazy",
|
||||
|
@ -27,15 +28,27 @@ M.defaults = {
|
|||
|
||||
M.ns = vim.api.nvim_create_namespace("lazy")
|
||||
|
||||
M.paths = {
|
||||
---@type string
|
||||
main = nil,
|
||||
---@type string
|
||||
plugins = nil,
|
||||
}
|
||||
|
||||
---@type table<string, LazyPlugin>
|
||||
M.plugins = {}
|
||||
|
||||
---@type LazyPlugin[]
|
||||
M.to_clean = {}
|
||||
|
||||
---@type LazyConfig
|
||||
M.options = {}
|
||||
|
||||
---@param opts? LazyConfig
|
||||
function M.setup(opts)
|
||||
M.options = vim.tbl_deep_extend("force", M.defaults, opts or {})
|
||||
M.paths.plugins = vim.fn.stdpath("config") .. "/lua/" .. M.options.plugins:gsub("%.", "/")
|
||||
M.paths.main = M.paths.plugins .. (vim.loop.fs_stat(M.paths.plugins .. ".lua") and ".lua" or "/init.lua")
|
||||
|
||||
-- vim.fn.mkdir(M.options.package_path, "p")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue