added option to specify custom config path for situations involving custom config directories such as those loaded from the nix store.

This commit is contained in:
BirdeeHub 2024-01-04 15:15:01 -08:00
commit d9a25b1566
2 changed files with 11 additions and 3 deletions

View file

@ -436,6 +436,10 @@ return {
-- "tutor", -- "tutor",
-- "zipPlugin", -- "zipPlugin",
}, },
-- to work around circumstances in which your config folder is
-- not in the normal location when performance.rtp.reset = true
-- such as when loading your config folder from the nix store.
custom_config_dir = vim.fn.stdpath("config"),
}, },
}, },
-- lazy can generate helptags from the headings in markdown readme files, -- lazy can generate helptags from the headings in markdown readme files,

View file

@ -134,7 +134,7 @@ M.defaults = {
rtp = { rtp = {
reset = true, -- reset the runtime path to $VIMRUNTIME and your config directory reset = true, -- reset the runtime path to $VIMRUNTIME and your config directory
---@type string[] ---@type string[]
paths = {}, -- add any custom paths here that you want to includes in the rtp paths = {}, -- add any custom paths here that you want to include in the rtp
---@type string[] list any plugins you want to disable here ---@type string[] list any plugins you want to disable here
disabled_plugins = { disabled_plugins = {
-- "gzip", -- "gzip",
@ -146,6 +146,10 @@ M.defaults = {
-- "tutor", -- "tutor",
-- "zipPlugin", -- "zipPlugin",
}, },
-- to work around circumstances in which your config folder is
-- not in the normal location when performance.rtp.reset = true
-- such as when loading your config folder from the nix store.
custom_config_dir = vim.fn.stdpath("config"),
}, },
}, },
-- lazy can generate helptags from the headings in markdown readme files, -- lazy can generate helptags from the headings in markdown readme files,
@ -227,12 +231,12 @@ function M.setup(opts)
M.me = Util.norm(vim.fn.fnamemodify(M.me, ":p:h:h:h:h")) M.me = Util.norm(vim.fn.fnamemodify(M.me, ":p:h:h:h:h"))
if M.options.performance.rtp.reset then if M.options.performance.rtp.reset then
vim.opt.rtp = { vim.opt.rtp = {
vim.fn.stdpath("config"), vim.options.performance.rtp.custom_config_dir,
vim.fn.stdpath("data") .. "/site", vim.fn.stdpath("data") .. "/site",
M.me, M.me,
vim.env.VIMRUNTIME, vim.env.VIMRUNTIME,
vim.fn.fnamemodify(vim.v.progpath, ":p:h:h") .. "/lib/nvim", vim.fn.fnamemodify(vim.v.progpath, ":p:h:h") .. "/lib/nvim",
vim.fn.stdpath("config") .. "/after", vim.options.performance.rtp.custom_config_dir .. "/after",
} }
end end
for _, path in ipairs(M.options.performance.rtp.paths) do for _, path in ipairs(M.options.performance.rtp.paths) do