mirror of https://github.com/folke/lazy.nvim.git
perf: added option to reset rtp to just your config and the neovim runtime
This commit is contained in:
parent
6affae6454
commit
ccc506d5f7
|
@ -54,6 +54,7 @@ M.defaults = {
|
||||||
---@type LazyCacheConfig
|
---@type LazyCacheConfig
|
||||||
cache = nil,
|
cache = nil,
|
||||||
reset_packpath = true, -- packpath will be reset to only include lazy. This makes packadd a lot faster
|
reset_packpath = true, -- packpath will be reset to only include lazy. This makes packadd a lot faster
|
||||||
|
reset_rtp = true,
|
||||||
},
|
},
|
||||||
debug = false,
|
debug = false,
|
||||||
}
|
}
|
||||||
|
@ -83,6 +84,15 @@ function M.setup(spec, opts)
|
||||||
if M.options.performance.reset_packpath then
|
if M.options.performance.reset_packpath then
|
||||||
vim.go.packpath = ""
|
vim.go.packpath = ""
|
||||||
end
|
end
|
||||||
|
if M.options.performance.reset_rtp then
|
||||||
|
local me = debug.getinfo(1, "S").source:sub(2)
|
||||||
|
me = vim.fn.fnamemodify(me, ":p:h:h:h:h")
|
||||||
|
vim.opt.rtp = {
|
||||||
|
vim.fn.stdpath("config"),
|
||||||
|
"$VIMRUNTIME",
|
||||||
|
me,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
vim.api.nvim_create_autocmd("User", {
|
||||||
pattern = "VeryLazy",
|
pattern = "VeryLazy",
|
||||||
|
|
Loading…
Reference in New Issue