mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-23 01:08:59 +02:00
feat(plugins): automatically handle plugin repo renames
This commit is contained in:
parent
4fbb7a2803
commit
59f3b3e096
1 changed files with 12 additions and 0 deletions
|
@ -77,6 +77,10 @@ local defaults = {
|
|||
},
|
||||
}
|
||||
|
||||
M.renames = {
|
||||
["windwp/nvim-spectre"] = "nvim-pack/nvim-spectre",
|
||||
}
|
||||
|
||||
---@type LazyVimConfig
|
||||
local options
|
||||
|
||||
|
@ -170,6 +174,14 @@ function M.init()
|
|||
-- this is needed to make sure options will be correctly applied
|
||||
-- after installing missing plugins
|
||||
require("lazyvim.config").load("options")
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
local add = Plugin.Spec.add
|
||||
Plugin.Spec.add = function(self, plugin, ...)
|
||||
if type(plugin) == "table" and M.renames[plugin[1]] then
|
||||
plugin[1] = M.renames[plugin[1]]
|
||||
end
|
||||
return add(self, plugin, ...)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue