diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-12-02 23:02:50 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-12-02 23:02:50 +0100 |
commit | 8213801b89e9d2a27c6b1df50881b8476679b870 (patch) | |
tree | ecd4a1e2489cff11c4e3c703dc80111d26b97a7a /.config/nvim/lua/plugin-loader.lua | |
parent | a3690ed8ca90823787fbaddb72f0a1874f1e999d (diff) |
LunarVim updates
Diffstat (limited to '.config/nvim/lua/plugin-loader.lua')
-rw-r--r-- | .config/nvim/lua/plugin-loader.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/.config/nvim/lua/plugin-loader.lua b/.config/nvim/lua/plugin-loader.lua index 1754b5b..9c83e46 100644 --- a/.config/nvim/lua/plugin-loader.lua +++ b/.config/nvim/lua/plugin-loader.lua @@ -5,8 +5,6 @@ local Log = require "core.log" -- we need to reuse this outside of init() local compile_path = get_config_dir() .. "/plugin/packer_compiled.lua" -local _, packer = pcall(require, "packer") - function plugin_loader.init(opts) opts = opts or {} @@ -26,10 +24,15 @@ function plugin_loader.init(opts) vim.cmd "packadd packer.nvim" end + if options.log and options.log.level then + log_level = options.log.level + end + + local _, packer = pcall(require, "packer") packer.init { package_root = package_root, compile_path = compile_path, - log = { level = "warn" }, + log = { level = log_level }, git = { clone_timeout = 300 }, max_jobs = 50, display = { @@ -67,6 +70,11 @@ end function plugin_loader.load(configurations) Log:debug "loading plugins configuration" + local packer_available, packer = pcall(require, "packer") + if not packer_available then + Log:warn "skipping loading plugins until Packer is installed" + return + end local status_ok, _ = xpcall(function() packer.startup(function(use) for _, plugins in ipairs(configurations) do |