clean nvimtree config

This commit is contained in:
siduck 2022-01-22 11:05:27 +05:30
parent 4077ff3520
commit a0dd82a292
2 changed files with 12 additions and 20 deletions

View File

@ -83,16 +83,8 @@ M.plugins = {
setup_lspconf = "", -- path of file containing setups of different lsps setup_lspconf = "", -- path of file containing setups of different lsps
}, },
nvimtree = { nvimtree = {
enable_git = 0,
-- packerCompile required after changing lazy_load -- packerCompile required after changing lazy_load
lazy_load = true, lazy_load = true,
ui = {
allow_resize = true,
side = "left",
width = 25,
hide_root_folder = true,
},
}, },
luasnip = { luasnip = {
snippet_path = {}, snippet_path = {},

View File

@ -1,20 +1,13 @@
local present, nvimtree = pcall(require, "nvim-tree") local present, nvimtree = pcall(require, "nvim-tree")
if not present then if not present then
return return
end end
local g = vim.g 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_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_highlight_opened_files = 0
g.nvim_tree_indent_markers = 1 g.nvim_tree_indent_markers = 1
g.nvim_tree_quit_on_open = 0 -- closes tree when file's opened 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 = { g.nvim_tree_show_icons = {
folders = 1, folders = 1,
files = 1, files = 1,
git = default.git_status, git = 1,
} }
g.nvim_tree_icons = { g.nvim_tree_icons = {
@ -53,7 +46,7 @@ g.nvim_tree_icons = {
}, },
} }
default = { local default = {
filters = { filters = {
dotfiles = false, dotfiles = false,
}, },
@ -68,13 +61,20 @@ default = {
enable = true, enable = true,
update_cwd = false, update_cwd = false,
}, },
view = default.ui, view = {
allow_resize = true,
side = "left",
width = 25,
hide_root_folder = true,
},
git = { git = {
enable = false,
ignore = false, ignore = false,
}, },
} }
local M = {} local M = {}
M.setup = function(override_flag) M.setup = function(override_flag)
if override_flag then if override_flag then
default = require("core.utils").tbl_override_req("nvim_tree", default) default = require("core.utils").tbl_override_req("nvim_tree", default)