Skip to content

Commit

Permalink
perf: added option to reset rtp to just your config and the neovim ru…
Browse files Browse the repository at this point in the history
…ntime
  • Loading branch information
folke committed Dec 3, 2022
1 parent 6affae6 commit ccc506d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lua/lazy/core/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ M.defaults = {
---@type LazyCacheConfig
cache = nil,
reset_packpath = true, -- packpath will be reset to only include lazy. This makes packadd a lot faster
reset_rtp = true,
},
debug = false,
}
Expand Down Expand Up @@ -83,6 +84,15 @@ function M.setup(spec, opts)
if M.options.performance.reset_packpath then
vim.go.packpath = ""
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", {
pattern = "VeryLazy",
Expand Down

0 comments on commit ccc506d

Please sign in to comment.