From 1c753e75b5766ac44ee48a6a67b2765103171d1d Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 6 Jul 2016 23:37:54 +0300 Subject: [PATCH] .vimrc: automatically close quickfix if it's the only window left --- .vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.vimrc b/.vimrc index bc4a54a..8892527 100644 --- a/.vimrc +++ b/.vimrc @@ -271,6 +271,8 @@ autocmd BufWritePost ~/.vimrc source ~/.vimrc | syntax on 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" | q | endif endif " Syntax highlighting -- 2.39.2