return { "nvim-neo-tree/neo-tree.nvim", branch = "v3.x", lazy = false, dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons", "MunifTanjim/nui.nvim", }, keys = { { "e", "Neotree toggle", desc = "Toggle file explorer" }, }, config = function() require("neo-tree").setup({ close_if_last_window = true, filesystem = { follow_current_file = { enabled = true }, filtered_items = { visible = true, hide_dotfiles = false, hide_gitignored = false, }, }, }) -- Open neo-tree when no file is specified (mirrors the vimrc's old -- NERDTree auto-open behavior), but not when nvim is reading stdin. local augroup = vim.api.nvim_create_augroup("neotree_auto", { clear = true }) vim.api.nvim_create_autocmd("StdinReadPre", { group = augroup, callback = function() vim.g.std_in = 1 end, }) vim.api.nvim_create_autocmd("VimEnter", { group = augroup, callback = function() if vim.fn.argc() == 0 and vim.g.std_in == nil then vim.cmd("Neotree show") end end, }) end, }