refactor: move core modules needed for loading under core

This commit is contained in:
Folke Lemaitre 2022-11-22 21:28:08 +01:00
parent 3218c2d9ec
commit fca984b18c
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
12 changed files with 27 additions and 32 deletions

41
lua/lazy/core/config.lua Normal file
View file

@ -0,0 +1,41 @@
local Util = require("lazy.core.util")
local M = {}
---@class LazyConfig
M.defaults = {
opt = true,
plugins = "config.plugins",
plugins_local = {
path = vim.fn.expand("~/projects"),
patterns = {},
},
package_path = vim.fn.stdpath("data") .. "/site/pack/lazy",
}
M.ns = vim.api.nvim_create_namespace("lazy")
---@type table<string, LazyPlugin>
M.plugins = {}
---@type LazyConfig
M.options = {}
---@param opts? LazyConfig
function M.setup(opts)
M.options = vim.tbl_deep_extend("force", M.defaults, opts or {})
-- vim.fn.mkdir(M.options.package_path, "p")
vim.api.nvim_create_autocmd("User", {
pattern = "VeryLazy",
once = true,
callback = function()
require("lazy.view").setup()
end,
})
Util.very_lazy()
end
return M