created 2003 · complexity intermediate · author David Kalita · version 6.0
Usually I have open one window with source code and one with error codes (command
:copen). When I quit the source code quickfix window stays open. The following causes the quickfix window to close automatically.
au BufEnter * call MyLastWindow() function! MyLastWindow() " if the window is quickfix go on if &buftype=="quickfix" " if this window is last on screen quit without warning if winbufnr(2) == -1 quit! endif endif endfunction