mirror of
https://github.com/LazyVim/starter.git
synced 2026-07-25 14:01:03 +00:00
chore: merge new config
This commit is contained in:
parent
66118ec8a3
commit
91879d99d9
1 changed files with 36 additions and 11 deletions
|
|
@ -14,6 +14,31 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local function generate_import_specs()
|
||||
local specs = {}
|
||||
|
||||
local function add_specs_from_dir(path)
|
||||
local uv = vim.loop
|
||||
local stats = uv.fs_readdir(uv.fs_opendir(vim.fn.stdpath("config") .. "/" .. "lua" .. "/" .. path, nil, 1000))
|
||||
if not stats then
|
||||
return
|
||||
end
|
||||
for _, stat in ipairs(stats) do
|
||||
-- print(stat.name)
|
||||
if stat.type == "directory" then
|
||||
local new_import_path = path .. "/" .. stat.name
|
||||
table.insert(specs, { import = new_import_path:gsub("/", ".") })
|
||||
add_specs_from_dir(new_import_path)
|
||||
elseif stat.name == "init.lua" then
|
||||
table.remove(specs) -- removes last element
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
add_specs_from_dir("plugins")
|
||||
return specs
|
||||
end
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue