diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index 2ca3a385..748d9777 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -60,6 +60,15 @@ type = "lua"; config = '' require("nvim-tree").setup() + + vim.api.nvim_create_autocmd("BufEnter", { + nested = true, + callback = function() + if #vim.api.nvim_list_wins() == 1 and require("nvim-tree.utils").is_nvim_tree_buf() then + vim.cmd "quit" + end + end + }) ''; } {