Skip to content

Commit ccc506d

Browse files
committed
perf: added option to reset rtp to just your config and the neovim runtime
1 parent 6affae6 commit ccc506d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lua/lazy/core/config.lua

+10
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ M.defaults = {
5454
---@type LazyCacheConfig
5555
cache = nil,
5656
reset_packpath = true, -- packpath will be reset to only include lazy. This makes packadd a lot faster
57+
reset_rtp = true,
5758
},
5859
debug = false,
5960
}
@@ -83,6 +84,15 @@ function M.setup(spec, opts)
8384
if M.options.performance.reset_packpath then
8485
vim.go.packpath = ""
8586
end
87+
if M.options.performance.reset_rtp then
88+
local me = debug.getinfo(1, "S").source:sub(2)
89+
me = vim.fn.fnamemodify(me, ":p:h:h:h:h")
90+
vim.opt.rtp = {
91+
vim.fn.stdpath("config"),
92+
"$VIMRUNTIME",
93+
me,
94+
}
95+
end
8696

8797
vim.api.nvim_create_autocmd("User", {
8898
pattern = "VeryLazy",

0 commit comments

Comments
 (0)