auto import plugin configs
This commit is contained in:
parent
2acfbc84b4
commit
2dd66af692
1 changed files with 9 additions and 4 deletions
11
init.lua
11
init.lua
|
@ -38,13 +38,18 @@ print("TEST")
|
||||||
-- Setup lazy
|
-- Setup lazy
|
||||||
function getSpec()
|
function getSpec()
|
||||||
if NVIM_CONFIG_STORE_PATH then
|
if NVIM_CONFIG_STORE_PATH then
|
||||||
-- TODO use same strategy as the tools/init.lua to auto import these
|
local plugins = {}
|
||||||
return { require("plugins.catppuccin") }
|
local plugins_path = debug.getinfo(2, "S").source:sub(2):match("(.*/)") .. "lua/plugins"
|
||||||
|
for _, file in ipairs(vim.fn.readdir(plugins_path, [[v:val =~ '\.lua$']])) do
|
||||||
|
local plugin = string.sub(file, 0, -5)
|
||||||
|
table.insert(plugins, require("plugins." .. plugin))
|
||||||
|
end
|
||||||
|
return plugins
|
||||||
else
|
else
|
||||||
-- TODO I want this to work in the nixos version
|
-- TODO I want this to work in the nixos version
|
||||||
-- but it is not resolving properly to the nix store.
|
-- but it is not resolving properly to the nix store.
|
||||||
-- Will revisit at some point, instead we manually pull them
|
-- Will revisit at some point, instead we manually pull them
|
||||||
-- in above.
|
-- in above with a directory scan.
|
||||||
return { { import = "plugins" } }
|
return { { import = "plugins" } }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue