]> git.phdru.name Git - dotfiles.git/commitdiff
.vimrc: Exit vim if the only window is option window
authorOleg Broytman <phd@phdru.name>
Mon, 1 Oct 2018 13:07:47 +0000 (16:07 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 1 Oct 2018 13:07:47 +0000 (16:07 +0300)
.vimrc

diff --git a/.vimrc b/.vimrc
index 9128b9448e7b4d9d850680e1e5980822cf9cb5e6..147fb38d400f64de2251c0ee30dec65804ce86ae 100644 (file)
--- a/.vimrc
+++ b/.vimrc
@@ -315,7 +315,8 @@ if version >= 700
 " Save all files before running any quickfix command (grep, makeprg, etc.)
 autocmd QuickFixCmdPre * wall
 " automatically close quickfix if it's the only window left
-autocmd WinEnter * if winnr('$') == 1 && &buftype == "quickfix" | quit | endif
+autocmd WinEnter * if winnr('$') == 1 && 
+   \ index(["nofile", "quickfix"], &buftype) >= 0 | quit | endif
 endif
 
 " Syntax highlighting