From 0b47d281953109286f4cdfe5f3208edce6a98340 Mon Sep 17 00:00:00 2001 From: Jidbo Date: Mon, 6 Sep 2021 13:45:22 +0200 Subject: [PATCH] auto close nerdtree if last window --- nvim/pluginoptions.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nvim/pluginoptions.vim b/nvim/pluginoptions.vim index 4cde02e..54dbfff 100644 --- a/nvim/pluginoptions.vim +++ b/nvim/pluginoptions.vim @@ -11,6 +11,8 @@ highlight NERDTreeCWD guifg=#9CA3AF ctermfg=gray highlight NERDTreeFlags guifg=#4B5563 ctermfg=green highlight NERDTreeExecFile guifg=#DC2626 ctermfg=green +" Exit Vim if NERDTree is the only window remaining in the only tab. +autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif " AIRLINE SETUP " =========================