mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat(plugin): dev.path can now be a function (#1157)
In some case, `dev.path .. plugin.name` is not enoguh. For example, when using `ghq` to manage projects, plugin directories may vary by onewrs of the plugins. With this change, users can do something like below ``` lua require("lazy").setup("plugins", { dev = { path = function(p) -- ghq local path, cnt = string.gsub(p.url, "^https://(.*)%.git$", "~/ghq/%1") if cnt == 1 then return path end -- fallback to default return "~/projects/" .. plugin.name end, }, }) ```
This commit is contained in:
parent
42694c4fda
commit
a6f782adc1
3 changed files with 15 additions and 8 deletions
|
@ -320,7 +320,7 @@ return {
|
|||
filter = true,
|
||||
},
|
||||
dev = {
|
||||
-- directory where you store your local plugin projects
|
||||
---@type string | fun(plugin: LazyPlugin): string directory where you store your local plugin projects
|
||||
path = "~/projects",
|
||||
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
|
||||
patterns = {}, -- For example {"folke"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue