From acdbe0dac155235b71bfe798a2f6505f39a11c8b Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 20 Sep 2014 20:43:54 +0200 Subject: [PATCH] Close vim if the only window left open is a NERDTree --- .vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.vimrc b/.vimrc index 97f4cc3..c9b92fd 100644 --- a/.vimrc +++ b/.vimrc @@ -28,6 +28,8 @@ Plugin 'jnurmine/Zenburn.git' " Quick file system tree, mapped to Ctrl+n for quick toggle Plugin 'scrooloose/nerdtree' map :NERDTreeToggle +" close vim if the only window left open is a NERDTree +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif " == Content convenience