Any built-in way of auto installing dev plugins? #50
Answered
by
filipekiss
MunifTanjim
asked this question in
Q&A
-
Auto-installing Currently I'm doing this: local local_git_dir = vim.fn.expand("$HOME/Dev")
local git_host_by_provider = {
github = "github.com",
}
local function make_local(spec)
if type(spec) == "string" then
spec = { spec }
end
local git_provider = spec.git_provider
if not git_provider or not git_host_by_provider[git_provider] then
git_provider = "github"
end
local plugin_dir = string.format("%s/%s/%s", local_git_dir, git_provider, spec[1])
local plugin_url = string.format("https://%s/%s", git_host_by_provider[git_provider], spec[1])
if not vim.loop.fs_stat(plugin_dir) then
vim.fn.system({ "git", "clone", plugin_url, plugin_dir })
end
spec.dev = true
spec.dir = plugin_dir
spec.url = plugin_url
return spec
end
local plugins = {
-- ...
make_local({
"MunifTanjim/nougat.nvim",
config = function()
require("config.plugins.nougat")
end,
}),
-- ...
} |
Beta Was this translation helpful? Give feedback.
Answered by
filipekiss
Mar 24, 2023
Replies: 1 comment
-
If you set require("lazy").setup("plugins", {
dev = {
-- the rest of your dev config here like path and patterns
fallback = true
}
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
MunifTanjim
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you set
fallback = true
in thedev
section when configuring lazy, it will clone the repository if it does not exists: