-- following options are the default -- each of these are documented in `:help nvim-tree.OPTION_NAME` local status_ok, nvim_tree = pcall(require, "nvim-tree") if not status_ok then return end local function my_on_attach(bufnr) local api = require "nvim-tree.api" local function opts(desc) return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } end -- default mappings g? to show them api.config.mappings.default_on_attach(bufnr) -- Mappings migrated from view.mappings.list vim.keymap.set('n', '', api.node.open.edit, opts('Open')) vim.keymap.set('n', '', api.node.navigate.parent_close, opts('Close Directory')) vim.keymap.set('n', 't', api.node.navigate.sibling.next, opts('Next Sibling')) vim.keymap.set('n', 's', api.node.navigate.sibling.prev, opts('Previous Sibling')) vim.keymap.set('n', '>', api.node.navigate.git.next, opts('Next Git')) vim.keymap.set('n', '<', api.node.navigate.git.prev, opts('Prev Git')) end nvim_tree.setup { on_attach = my_on_attach, disable_netrw = true, hijack_netrw = true, open_on_tab = false, hijack_cursor = false, update_cwd = true, -- update_to_buf_dir = { -- enable = true, -- auto_open = true, -- }, renderer = { icons = { glyphs = { default = "", symlink = "", git = { unstaged = "", staged = "S", unmerged = "", renamed = "➜", deleted = "", untracked = "U", ignored = "◌", }, folder = { default = "", open = "", empty = "", empty_open = "", symlink = "", }, }, }, }, diagnostics = { enable = true, icons = { hint = "", info = "", warning = "", error = "", }, }, update_focused_file = { enable = true, update_cwd = true, ignore_list = {}, }, system_open = { cmd = nil, args = {}, }, filters = { dotfiles = false, custom = {}, }, git = { enable = true, ignore = true, timeout = 500, }, view = { width = 30, side = "left", -- auto_resize = true, number = false, relativenumber = false, }, trash = { 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, -- }, }