feat: temporary colorscheme to use during install during startup

This commit is contained in:
Folke Lemaitre 2022-12-02 19:18:10 +01:00
parent 0ba218a065
commit 7ec65e4cd9
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
2 changed files with 15 additions and 2 deletions

View File

@ -10,7 +10,6 @@ M.defaults = {
-- version = "*", -- enable this to try installing the latest stable versions of plugins
},
lockfile = vim.fn.stdpath("config") .. "/lazy-lock.json", -- lockfile generated after running update.
install_missing = true, -- install missing plugins on startup. This doesn't increase startup time.
concurrency = nil, -- set to a number to limit the maximum amount of concurrent tasks
git = {
-- defaults for `Lazy log`
@ -30,6 +29,13 @@ M.defaults = {
---@type string[]
patterns = {}, -- For example {"folke"}
},
install = {
-- install missing plugins on startup. This doesn't increase startup time.
missing = true,
-- try to load one of the colorschemes in this list when starting an install during startup
-- the first colorscheme that is found will be used
colorscheme = { "habamax" },
},
ui = {
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
border = "none",
@ -78,6 +84,8 @@ function M.setup(spec, opts)
M.spec = spec
M.options = vim.tbl_deep_extend("force", M.defaults, opts or {})
M.options.performance.cache = require("lazy.core.cache")
table.insert(M.options.install.colorscheme, "habamax")
M.root = M.options.package.path .. "/pack/" .. M.options.package.name .. "/opt"
if M.options.performance.reset_packpath then

View File

@ -9,8 +9,13 @@ M.init_done = false
function M.setup()
-- install missing plugins
if Config.options.install_missing then
if Config.options.install.missing then
Util.track("install")
for _, colorscheme in ipairs(Config.options.install.colorscheme) do
if pcall(vim.cmd.colorscheme, colorscheme) then
break
end
end
for _, plugin in pairs(Config.plugins) do
if not plugin._.installed then
vim.cmd("do User LazyInstallPre")