diff --git a/plugins/utils/nvim-tree.nix b/plugins/utils/nvim-tree.nix
index 3e2d93c5..ecc9616a 100644
--- a/plugins/utils/nvim-tree.nix
+++ b/plugins/utils/nvim-tree.nix
@@ -223,7 +223,6 @@ in
         hijack_netrw = cfg.hijackNetrw;
         open_on_setup = cfg.openOnSetup;
         ignore_ft_on_setup = cfg.ignoreFtOnSetup;
-        auto_close = cfg.autoClose;
         open_on_tab = cfg.openOnTab;
         hijack_cursor = cfg.hijackCursor;
         update_cwd = cfg.updateCwd;
@@ -267,6 +266,14 @@ in
         nvim-web-devicons
       ];
 
+      autoCmd = mkIf cfg.autoClose [
+        {
+          event = "BufEnter";
+          command = "if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif";
+          nested = true;
+        }
+      ];
+
       extraConfigLua = ''
         require('nvim-tree').setup(${helpers.toLuaObject options})
       '';