docs: updated cache settings

This commit is contained in:
Folke Lemaitre 2023-02-13 11:59:03 +01:00
parent 856ab9e476
commit 8b672c41cb
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
2 changed files with 1 additions and 14 deletions

View File

@ -347,7 +347,7 @@ return {
init = " ", init = " ",
import = " ", import = " ",
keys = " ", keys = " ",
lazy = " ", lazy = "󰒲 ",
loaded = "●", loaded = "●",
not_loaded = "○", not_loaded = "○",
plugin = " ", plugin = " ",
@ -409,14 +409,6 @@ return {
performance = { performance = {
cache = { cache = {
enabled = true, enabled = true,
path = vim.fn.stdpath("cache") .. "/lazy/cache",
-- Once one of the following events triggers, caching will be disabled.
-- To cache all modules, set this to `{}`, but that is not recommended.
-- The default is to disable on:
-- * VimEnter: not useful to cache anything else beyond startup
-- * BufReadPre: this will be triggered early when opening a file from the command line directly
disable_events = { "UIEnter", "BufReadPre" },
ttl = 3600 * 24 * 5, -- keep unused modules for up to 5 days
}, },
reset_packpath = true, -- reset the package path to improve startup time reset_packpath = true, -- reset the package path to improve startup time
rtp = { rtp = {

View File

@ -131,12 +131,7 @@ function M.colors()
end end
function M.update() function M.update()
local cache_config = M.extract("lua/lazy/core/cache.lua", "\nM%.config = ({.-\n})")
local config = M.extract("lua/lazy/core/config.lua", "\nM%.defaults = ({.-\n})") local config = M.extract("lua/lazy/core/config.lua", "\nM%.defaults = ({.-\n})")
config = config:gsub(
"\n%s*%-%-%-@type LazyCacheConfig.*cache = nil,",
"\n" .. M.indent("cache = " .. cache_config .. ",", 4)
)
config = config:gsub("%s*debug = false.\n", "\n") config = config:gsub("%s*debug = false.\n", "\n")
M.save({ M.save({
bootstrap = M.extract("lua/lazy/init.lua", "function M%.bootstrap%(%)\n(.-)\nend"), bootstrap = M.extract("lua/lazy/init.lua", "function M%.bootstrap%(%)\n(.-)\nend"),