diff options
author | Abouzar Parvan <[email protected]> | 2021-09-26 09:37:06 +0330 |
---|---|---|
committer | GitHub <[email protected]> | 2021-09-26 08:07:06 +0200 |
commit | 8009ff4fee6c46f2ea80b084447fe2052740c378 (patch) | |
tree | 55e4df2d541e34d5d3b639a8360c0da7d119c78a /lua/core/nvimtree.lua | |
parent | 64a5964b545ec7f3f78f725ec96cba553a496d9f (diff) |
fix: use the new nvim-tree syntax (#1619)
Diffstat (limited to 'lua/core/nvimtree.lua')
-rw-r--r-- | lua/core/nvimtree.lua | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lua/core/nvimtree.lua b/lua/core/nvimtree.lua index 5007cf7c..44d3031f 100644 --- a/lua/core/nvimtree.lua +++ b/lua/core/nvimtree.lua @@ -6,6 +6,14 @@ function M.config() active = true, on_config_done = nil, side = "left", + setup = { + auto_open = 0, + auto_close = 1, + tab_open = 0, + update_focused_file = { + enable = 1, + }, + }, width = 30, show_icons = { git = 1, @@ -15,14 +23,10 @@ function M.config() tree_width = 30, }, ignore = { ".git", "node_modules", ".cache" }, - auto_open = 0, - auto_close = 1, quit_on_open = 0, - follow = 1, hide_dotfiles = 1, git_hl = 1, root_folder_modifier = ":t", - tab_open = 0, allow_resize = 1, lsp_diagnostics = 1, auto_ignore_ft = { "startify", "dashboard" }, @@ -57,12 +61,16 @@ function M.setup() end local g = vim.g + for opt, val in pairs(lvim.builtin.nvimtree) do + g["nvim_tree_" .. opt] = val + end + -- Implicitly update nvim-tree when project module is active if lvim.builtin.project.active then - lvim.builtin.nvimtree.update_cwd = 1 lvim.builtin.nvimtree.respect_buf_cwd = 1 - lvim.builtin.nvimtree.disable_netrw = 0 - lvim.builtin.nvimtree.hijack_netrw = 0 + lvim.builtin.nvimtree.setup.update_cwd = 1 + lvim.builtin.nvimtree.setup.disable_netrw = 0 + lvim.builtin.nvimtree.setup.hijack_netrw = 0 vim.g.netrw_banner = 0 end @@ -92,7 +100,7 @@ function M.setup() if lvim.builtin.nvimtree.on_config_done then lvim.builtin.nvimtree.on_config_done(nvim_tree_config) end - require("nvim-tree").setup(lvim.builtin.nvimtree) + require("nvim-tree").setup(lvim.builtin.nvimtree.setup) end function M.on_open() |