Skip to content

Commit

Permalink
feat: temporary colorscheme to use during install during startup
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 2, 2022
1 parent 0ba218a commit 7ec65e4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 9 additions & 1 deletion lua/lazy/core/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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",
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion lua/lazy/core/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 7ec65e4

Please sign in to comment.