chore: merge new config

This commit is contained in:
fm39hz-laptop 2024-10-20 16:04:27 +07:00
parent 66118ec8a3
commit 91879d99d9

View file

@ -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