require("nvim-tree").setup({ view = { float = { enable = true, open_win_config = function() local screen_w = vim.opt.columns:get() local screen_h = vim.opt.lines:get() local window_w = math.floor(screen_w * 0.6) local window_h = math.floor(screen_h * 0.7) local center_x = math.floor((screen_w - window_w) / 2) local center_y = math.floor((screen_h - window_h) / 2) return { border = "rounded", relative = "editor", row = center_y, col = center_x, width = window_w, height = window_h, } end, }, width = 30, }, on_attach = function(bufnr) local api = require("nvim-tree.api") api.config.mappings.default_on_attach(bufnr) vim.keymap.set("n", "", api.tree.close, { buffer = bufnr, nowait = true }) end, actions = { open_file = { quit_on_open = true, }, }, renderer = { highlight_git = true, icons = { show = { git = true, folder = true, file = true, folder_arrow = true, }, }, }, filters = { dotfiles = true, }, })