Vim Tips Wiki
Register
Advertisement
Tip 536 Printable Monobook Previous Next

created August 21, 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

Comments


Advertisement