Skip to content

Commit

Permalink
Merge pull request LunarVim#145 from gnmearacaun/nvim-tree0.7
Browse files Browse the repository at this point in the history
some fixes to nvim-tree as some plugin options have changed
  • Loading branch information
ChristianChiarulli authored May 23, 2022
2 parents efc7a33 + 23a13ba commit f920985
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions lua/user/nvim-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ if not config_status_ok then
return
end

-- Replaces auto_close
local tree_cb = nvim_tree_config.nvim_tree_callback
vim.api.nvim_create_autocmd("BufEnter", {
nested = true,
callback = function()
if #vim.api.nvim_list_wins() == 1 and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil then
vim.cmd "quit"
end
end
})

nvim_tree.setup {
disable_netrw = true,
Expand All @@ -42,14 +51,9 @@ nvim_tree.setup {
"dashboard",
"alpha",
},
auto_close = true,
open_on_tab = false,
hijack_cursor = false,
update_cwd = true,
update_to_buf_dir = {
enable = true,
auto_open = true,
},
diagnostics = {
enable = true,
icons = {
Expand Down Expand Up @@ -82,7 +86,6 @@ nvim_tree.setup {
height = 30,
hide_root_folder = false,
side = "left",
auto_resize = true,
mappings = {
custom_only = false,
list = {
Expand All @@ -98,15 +101,23 @@ nvim_tree.setup {
cmd = "trash",
require_confirm = true,
},
quit_on_open = 0,
git_hl = 1,
disable_window_picker = 0,
root_folder_modifier = ":t",
show_icons = {
git = 1,
folders = 1,
files = 1,
folder_arrows = 1,
tree_width = 30,
actions = {
open_file = {
quit_on_open = true,
window_picker = {
enable = false,
},
},
},

-- unknown options as of 22.05
--
-- update_to_buf_dir = {
-- enable = true,
-- auto_open = true,
-- },
-- auto_resize = true,
-- git_hl = 1,
-- root_folder_modifier = ":t",

}

0 comments on commit f920985

Please sign in to comment.