From 876f7bd47124b4b2881917b36c5d29f3a898eab5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 21 Dec 2022 15:19:14 +0100 Subject: [PATCH] feat(loader): allow to add extra paths to rtp reset. Fixes #64 --- README.md | 2 ++ lua/lazy/core/config.lua | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 1586c80..f3c8d25 100644 --- a/README.md +++ b/README.md @@ -309,6 +309,8 @@ return { reset_packpath = true, -- reset the package path to improve startup time rtp = { reset = true, -- reset the runtime path to $VIMRUNTIME and your config directory + ---@type string[] + paths = {}, -- add any custom paths here that you want to indluce in the rtp ---@type string[] list any plugins you want to disable here disabled_plugins = { -- "gzip", diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index f204183..63bc99f 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -69,6 +69,8 @@ M.defaults = { reset_packpath = true, -- reset the package path to improve startup time rtp = { reset = true, -- reset the runtime path to $VIMRUNTIME and your config directory + ---@type string[] + paths = {}, -- add any custom paths here that you want to indluce in the rtp ---@type string[] list any plugins you want to disable here disabled_plugins = { -- "gzip", @@ -142,6 +144,9 @@ function M.setup(spec, opts) vim.fn.stdpath("config") .. "/after", } end + for _, path in ipairs(M.options.performance.rtp.paths) do + vim.opt.rtp:append(path) + end vim.opt.rtp:append(M.options.readme.root) -- disable plugin loading since we do all of that ourselves