Skip to content

Commit 7ec65e4

Browse files
committed
feat: temporary colorscheme to use during install during startup
1 parent 0ba218a commit 7ec65e4

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

lua/lazy/core/config.lua

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ M.defaults = {
1010
-- version = "*", -- enable this to try installing the latest stable versions of plugins
1111
},
1212
lockfile = vim.fn.stdpath("config") .. "/lazy-lock.json", -- lockfile generated after running update.
13-
install_missing = true, -- install missing plugins on startup. This doesn't increase startup time.
1413
concurrency = nil, -- set to a number to limit the maximum amount of concurrent tasks
1514
git = {
1615
-- defaults for `Lazy log`
@@ -30,6 +29,13 @@ M.defaults = {
3029
---@type string[]
3130
patterns = {}, -- For example {"folke"}
3231
},
32+
install = {
33+
-- install missing plugins on startup. This doesn't increase startup time.
34+
missing = true,
35+
-- try to load one of the colorschemes in this list when starting an install during startup
36+
-- the first colorscheme that is found will be used
37+
colorscheme = { "habamax" },
38+
},
3339
ui = {
3440
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
3541
border = "none",
@@ -78,6 +84,8 @@ function M.setup(spec, opts)
7884
M.spec = spec
7985
M.options = vim.tbl_deep_extend("force", M.defaults, opts or {})
8086
M.options.performance.cache = require("lazy.core.cache")
87+
table.insert(M.options.install.colorscheme, "habamax")
88+
8189
M.root = M.options.package.path .. "/pack/" .. M.options.package.name .. "/opt"
8290

8391
if M.options.performance.reset_packpath then

lua/lazy/core/loader.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ M.init_done = false
99

1010
function M.setup()
1111
-- install missing plugins
12-
if Config.options.install_missing then
12+
if Config.options.install.missing then
1313
Util.track("install")
14+
for _, colorscheme in ipairs(Config.options.install.colorscheme) do
15+
if pcall(vim.cmd.colorscheme, colorscheme) then
16+
break
17+
end
18+
end
1419
for _, plugin in pairs(Config.plugins) do
1520
if not plugin._.installed then
1621
vim.cmd("do User LazyInstallPre")

0 commit comments

Comments
 (0)