mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-19 04:46:45 +00:00
style: formatting
This commit is contained in:
parent
e73626a344
commit
0219a531ed
9 changed files with 698 additions and 695 deletions
|
@ -4,19 +4,19 @@ local M = {}
|
|||
|
||||
---@class LazyConfig
|
||||
M.defaults = {
|
||||
opt = true,
|
||||
plugins = {},
|
||||
plugins_local = {
|
||||
path = vim.fn.expand("~/projects"),
|
||||
patterns = {
|
||||
"folke",
|
||||
},
|
||||
},
|
||||
plugins_config = {
|
||||
module = "plugins",
|
||||
path = vim.fn.stdpath("config") .. "/lua/plugins",
|
||||
},
|
||||
package_path = vim.fn.stdpath("data") .. "/site/pack/lazy",
|
||||
opt = true,
|
||||
plugins = {},
|
||||
plugins_local = {
|
||||
path = vim.fn.expand("~/projects"),
|
||||
patterns = {
|
||||
"folke",
|
||||
},
|
||||
},
|
||||
plugins_config = {
|
||||
module = "plugins",
|
||||
path = vim.fn.stdpath("config") .. "/lua/plugins",
|
||||
},
|
||||
package_path = vim.fn.stdpath("data") .. "/site/pack/lazy",
|
||||
}
|
||||
|
||||
M.ns = vim.api.nvim_create_namespace("lazy")
|
||||
|
@ -32,37 +32,37 @@ M.has_config = {}
|
|||
|
||||
---@param opts? LazyConfig
|
||||
function M.setup(opts)
|
||||
M.options = vim.tbl_deep_extend("force", M.defaults, opts or {})
|
||||
M.options = vim.tbl_deep_extend("force", M.defaults, opts or {})
|
||||
|
||||
vim.fn.mkdir(M.options.package_path, "p")
|
||||
vim.fn.mkdir(M.options.package_path, "p")
|
||||
|
||||
for _, entry in ipairs(Util.scandir(M.options.plugins_config.path)) do
|
||||
local name, modpath
|
||||
for _, entry in ipairs(Util.scandir(M.options.plugins_config.path)) do
|
||||
local name, modpath
|
||||
|
||||
if entry.type == "file" then
|
||||
modpath = entry.path
|
||||
name = entry.name:match("(.*)%.lua")
|
||||
elseif entry.type == "directory" then
|
||||
modpath = M.options.plugins_config.path .. "/" .. entry.name .. "/init.lua"
|
||||
if vim.loop.fs_stat(modpath) then
|
||||
name = entry.name
|
||||
end
|
||||
end
|
||||
if entry.type == "file" then
|
||||
modpath = entry.path
|
||||
name = entry.name:match("(.*)%.lua")
|
||||
elseif entry.type == "directory" then
|
||||
modpath = M.options.plugins_config.path .. "/" .. entry.name .. "/init.lua"
|
||||
if vim.loop.fs_stat(modpath) then
|
||||
name = entry.name
|
||||
end
|
||||
end
|
||||
|
||||
if name then
|
||||
M.has_config[M.options.plugins_config.module .. "." .. name] = modpath
|
||||
end
|
||||
end
|
||||
if name then
|
||||
M.has_config[M.options.plugins_config.module .. "." .. name] = modpath
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
once = true,
|
||||
callback = function()
|
||||
-- require("lazy.view").setup()
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
once = true,
|
||||
callback = function()
|
||||
-- require("lazy.view").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
Util.very_lazy()
|
||||
Util.very_lazy()
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue