From a2d91acc845a893553fcc65e12298366a8a1c9c0 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Fri, 24 Dec 2021 23:35:13 +0530 Subject: [PATCH] nvimtree: Allow changing lazy load from chadrc | Resolve https://github.com/NvChad/NvChad/issues/621 a packerCompile is needed after changin the config value in chadrc --- lua/core/default_config.lua | 2 ++ lua/plugins/init.lua | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 39240ed..34f19af 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -79,6 +79,8 @@ M.plugins = { }, nvimtree = { enable_git = 0, + -- packerCompile required after changing lazy_load + lazy_load = true, ui = { allow_resize = true, diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 679c62d..42c55ff 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -205,7 +205,8 @@ return packer.startup(function() use { "kyazdani42/nvim-tree.lua", disable = not plugin_settings.status.nvimtree, - cmd = { "NvimTreeToggle", "NvimTreeFocus" }, + -- only set cmd if lazy load is enabled + cmd = plugin_settings.options.nvimtree.lazy_load and { "NvimTreeToggle", "NvimTreeFocus" }, config = override_req("nvim_tree", "plugins.configs.nvimtree"), setup = function() require("core.mappings").nvimtree()