From ccc506d5f71af1cce97ebde0c780f7a6454e2ace Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 3 Dec 2022 17:42:54 +0100 Subject: [PATCH] perf: added option to reset rtp to just your config and the neovim runtime --- lua/lazy/core/config.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index f4405e8..56d8352 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -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, } @@ -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",