mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-28 11:24:14 +00:00
https://github.com/folke/lazy.nvim/pull/1157 makes dev.extra_paths unnecessary and allows for more options. Thus, this is an alternative pr to https://github.com/folke/lazy.nvim/pull/1259 that would be sufficient in conjunction with pull/1157
This commit is contained in:
parent
96584866b9
commit
2c9473ada5
2 changed files with 28 additions and 2 deletions
12
README.md
12
README.md
|
@ -436,6 +436,18 @@ return {
|
|||
-- "tutor",
|
||||
-- "zipPlugin",
|
||||
},
|
||||
-- for niche situations where you need to inject earlier in the load cycle
|
||||
-- such as adding things that must be sourced before VIMRUNTIME
|
||||
---@type fun(DEFAULT: string[], ME: string, VIMRUNTIME: string, NVIM_LIB: string): string[]
|
||||
override_base_rtp = function(DEFAULT, ME, VIMRUNTIME, NVIM_LIB) return DEFAULT end
|
||||
-- DEFAULT = {
|
||||
-- vim.fn.stdpath("config"),
|
||||
-- vim.fn.stdpath("data") .. "/site",
|
||||
-- ME,
|
||||
-- VIMRUNTIME,
|
||||
-- NVIM_LIB,
|
||||
-- vim.fn.stdpath("config") .. "/after",
|
||||
-- }
|
||||
},
|
||||
},
|
||||
-- lazy can generate helptags from the headings in markdown readme files,
|
||||
|
|
|
@ -146,6 +146,18 @@ M.defaults = {
|
|||
-- "tutor",
|
||||
-- "zipPlugin",
|
||||
},
|
||||
-- for niche situations where you need to inject earlier in the load cycle
|
||||
-- such as adding things that must be sourced before VIMRUNTIME
|
||||
---@type fun(DEFAULT: string[], ME: string, VIMRUNTIME: string, NVIM_LIB: string): string[]
|
||||
override_base_rtp = function(DEFAULT, ME, VIMRUNTIME, NVIM_LIB) return DEFAULT end
|
||||
-- DEFAULT = {
|
||||
-- vim.fn.stdpath("config"),
|
||||
-- vim.fn.stdpath("data") .. "/site",
|
||||
-- ME,
|
||||
-- VIMRUNTIME,
|
||||
-- NVIM_LIB,
|
||||
-- vim.fn.stdpath("config") .. "/after",
|
||||
-- }
|
||||
},
|
||||
},
|
||||
-- lazy can generate helptags from the headings in markdown readme files,
|
||||
|
@ -226,14 +238,16 @@ function M.setup(opts)
|
|||
M.me = debug.getinfo(1, "S").source:sub(2)
|
||||
M.me = Util.norm(vim.fn.fnamemodify(M.me, ":p:h:h:h:h"))
|
||||
if M.options.performance.rtp.reset then
|
||||
vim.opt.rtp = {
|
||||
local NVIM_LIB = vim.fn.fnamemodify(vim.v.progpath, ":p:h:h") .. "/lib/nvim"
|
||||
local base_rtp = {
|
||||
vim.fn.stdpath("config"),
|
||||
vim.fn.stdpath("data") .. "/site",
|
||||
M.me,
|
||||
vim.env.VIMRUNTIME,
|
||||
vim.fn.fnamemodify(vim.v.progpath, ":p:h:h") .. "/lib/nvim",
|
||||
NVIM_LIB,
|
||||
vim.fn.stdpath("config") .. "/after",
|
||||
}
|
||||
vim.opt.rtp = M.options.performance.rtp.override_base_rtp(base_rtp, M.me, vim.env.VIMRUNTIME, NVIM_LIB)
|
||||
end
|
||||
for _, path in ipairs(M.options.performance.rtp.paths) do
|
||||
vim.opt.rtp:append(path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue