refactor: simplify spec setup now that `cond` is usable for imports

pull/2/head
Micah Halter 2023-10-06 11:59:27 -04:00
parent 4e9e8032ab
commit 3697cce5a1
No known key found for this signature in database
GPG Key ID: 4224A6EA9A8CAAA8
1 changed files with 6 additions and 9 deletions

View File

@ -10,21 +10,18 @@ vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
-- Whether or not to use stable releases of AstroNvim -- Whether or not to use stable releases of AstroNvim
local USE_STABLE = false local USE_STABLE = false
local spec = {
-- TODO: remove branch v4 on release
{ "AstroNvim/AstroNvim", branch = "v4", version = USE_STABLE and "*" or nil, import = "astronvim.plugins" },
-- { "AstroNvim/AstroNvim", version = "3.x", import = "astronvim.plugins" }, -- use this line to only get updates for v3 and avoid the breaking changes if v4 is released
}
if USE_STABLE then table.insert(spec, { import = "astronvim.lazy_snapshot" }) end -- pin plugins to known stable versions/commits
require("lazy").setup { require("lazy").setup {
spec = vim.list_extend(spec, { spec = {
-- TODO: remove branch v4 on release
{ "AstroNvim/AstroNvim", branch = "v4", version = USE_STABLE and "*" or nil, import = "astronvim.plugins" },
-- { "AstroNvim/AstroNvim", version = "3.x", import = "astronvim.plugins" }, -- use this line to only get updates for v3 and avoid the breaking changes if v4 is released
{ import = "astronvim.lazy_snapshot", cond = USE_STABLE },
-- AstroCommunity import any community modules here -- AstroCommunity import any community modules here
-- TODO: Remove branch v4 on release -- TODO: Remove branch v4 on release
-- { "AstroNvim/astrocommunity", branch = "v4" }, -- { "AstroNvim/astrocommunity", branch = "v4" },
-- { import = "astrocommunity.pack.lua" }, -- { import = "astrocommunity.pack.lua" },
{ import = "plugins" }, -- import/override with your plugins { import = "plugins" }, -- import/override with your plugins
}), },
defaults = { defaults = {
-- By default, only AstroNvim plugins will be lazy-loaded. Your custom plugins will load during startup. -- By default, only AstroNvim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.