Automatically Close NerdTree When Using Vimade
As the NERDTree README points out, you can automatically close Vim if NERDTree is the only open window by adding this to your configuration:
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
If you are using vimade and Neovim (I couldn’t reproduce in Vim), however, you may see something like this in your terminal after Neovim exits:
Error detected while processing function vimade#Tick[1]..vimade#CheckWindows[3]..provider#python3#Call: line 18: Invalid channel: 3
The fix is to run VimadeDisable before automatically quitting, so change the above line in your configuration to this:
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | execute 'VimadeDisable' | q | endif