diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 3d8e2a0..f2c3c33 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -83,16 +83,8 @@ M.plugins = { setup_lspconf = "", -- path of file containing setups of different lsps }, nvimtree = { - enable_git = 0, -- packerCompile required after changing lazy_load lazy_load = true, - - ui = { - allow_resize = true, - side = "left", - width = 25, - hide_root_folder = true, - }, }, luasnip = { snippet_path = {}, diff --git a/lua/plugins/configs/nvimtree.lua b/lua/plugins/configs/nvimtree.lua index 5f18230..5b0eb75 100644 --- a/lua/plugins/configs/nvimtree.lua +++ b/lua/plugins/configs/nvimtree.lua @@ -1,20 +1,13 @@ local present, nvimtree = pcall(require, "nvim-tree") + if not present then return end local g = vim.g -local default = { - conf = require("core.utils").load_config().plugins.options.nvimtree, -} - -default = { - git_status = default.conf.enable_git, - ui = default.conf.ui, -} g.nvim_tree_add_trailing = 0 -- append a trailing slash to folder names -g.nvim_tree_git_hl = default.git_status +g.nvim_tree_git_hl = 0 g.nvim_tree_highlight_opened_files = 0 g.nvim_tree_indent_markers = 1 g.nvim_tree_quit_on_open = 0 -- closes tree when file's opened @@ -28,7 +21,7 @@ g.nvim_tree_window_picker_exclude = { g.nvim_tree_show_icons = { folders = 1, files = 1, - git = default.git_status, + git = 1, } g.nvim_tree_icons = { @@ -53,7 +46,7 @@ g.nvim_tree_icons = { }, } -default = { +local default = { filters = { dotfiles = false, }, @@ -68,13 +61,20 @@ default = { enable = true, update_cwd = false, }, - view = default.ui, + view = { + allow_resize = true, + side = "left", + width = 25, + hide_root_folder = true, + }, git = { + enable = false, ignore = false, }, } local M = {} + M.setup = function(override_flag) if override_flag then default = require("core.utils").tbl_override_req("nvim_tree", default)