vim.cmd [[
    nnoremap <C-n> :NvimTreeClose<CR>
    nnoremap <leader>n :NvimTreeFocus<CR>
]]
--  NvimTreeOpen, NvimTreeClose, NvimTreeFocus, NvimTreeFindFileToggle, and NvimTreeResize are also available if you need them

vim.cmd [[
    highlight! NvimTreeIndentMarker ctermfg=11
]]

-- each of these are documented in `:help nvim-tree.OPTION_NAME`
require('nvim-tree').setup {
    create_in_closed_folder = false,
    hijack_netrw         = true,
    auto_reload_on_write = true,
    open_on_tab          = false,
    hijack_cursor        = false,
    update_cwd           = false,
    respect_buf_cwd      = true,
    hijack_unnamed_buffer_when_opening = true,
    hijack_directories   = {
        enable = true,
        auto_open = true,
    },
    diagnostics = {
        enable = true,
        icons = {
            hint = "",
            info = "",
            warning = "",
            error = "",
        }
    },
    git = {
        enable = true,
        ignore = false,
    },
    filters = {
        dotfiles = false,
        custom = { '.git' }
    },
    view = {
        width = 30,
        hide_root_folder = false,
        side = 'left',
    },
    renderer = {
        add_trailing = true,
        group_empty = true,
        highlight_git = true,
        highlight_opened_files = "all",
        root_folder_modifier = ":~",
        special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
        indent_markers = {
            enable = false,
            icons = {
                corner = "└ ",
                edge = "│ ",
                none = " ",
            },
        },
        icons = {
            padding = " ",
            symlink_arrow = " -> ",
            webdev_colors = true,
            show = {
                file = true,
                folder = true,
                folder_arrow = false,
                git = true,
            },
            glyphs = {
                default = "",
                symlink = "",
                bookmark = "",
                folder = {
                    arrow_closed = "",
                    arrow_open = "",
                    default = "",
                    open = "",
                    empty = "",
                    empty_open = "",
                    symlink = "",
                    symlink_open = "",
                },
                git = {
                    unstaged = "✗",
                    staged = "✓",
                    unmerged = "",
                    renamed = "→",
                    untracked = "…",
                    deleted = "",
                    ignored = "◌",
                },
            },
        },
    },
    actions = {
        open_file = {
            window_picker = {
                enable = true,
                chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
                exclude = {
                    filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
                    buftype = { "nofile", "terminal", "help" },
                },
            },
        },
    },
}
