summaryrefslogtreecommitdiff
path: root/lua/lvim/plugin-loader.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2021-12-09 17:08:53 +0100
committerGitHub <[email protected]>2021-12-09 17:08:53 +0100
commit307db8936b291b82124f05bdcfeb85be5464f21d (patch)
treecdc0ccdf8e9d58be61b61b78fffa012ed758f33d /lua/lvim/plugin-loader.lua
parent68cdb62f87543d5420e70c241ebd5942ed9c7b0e (diff)
feat: multiple enhancements to lvim-reload (#2054)
Diffstat (limited to 'lua/lvim/plugin-loader.lua')
-rw-r--r--lua/lvim/plugin-loader.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/lua/lvim/plugin-loader.lua b/lua/lvim/plugin-loader.lua
index 5bde8b1b..c5220d59 100644
--- a/lua/lvim/plugin-loader.lua
+++ b/lua/lvim/plugin-loader.lua
@@ -28,7 +28,13 @@ function plugin_loader.init(opts)
package_root = package_root,
compile_path = compile_path,
log = { level = log_level },
- git = { clone_timeout = 300 },
+ git = {
+ clone_timeout = 300,
+ subcommands = {
+ -- this is more efficient than what Packer is using
+ fetch = "fetch --no-tags --no-recurse-submodules --update-shallow --progress",
+ },
+ },
max_jobs = 50,
display = {
open_fn = function()
@@ -36,6 +42,8 @@ function plugin_loader.init(opts)
end,
},
}
+
+ vim.cmd [[autocmd User PackerComplete lua require('lvim.utils.hooks').run_on_packer_complete()]]
end
-- packer expects a space separated list
@@ -104,4 +112,11 @@ function plugin_loader.sync_core_plugins()
pcall_packer_command("sync", core_plugins)
end
+function plugin_loader.ensure_installed()
+ plugin_loader.cache_clear()
+ local all_plugins = _G.packer_plugins or plugin_loader.get_core_plugins()
+ Log:trace(string.format("Syncing core plugins: [%q]", table.concat(all_plugins, ", ")))
+ pcall_packer_command("install", all_plugins)
+end
+
return plugin_loader