How to open Quickfix window automatically after make

The Quickfix feature of Vim can be used to view errors or warnings produced by a compilation in a window and jump to those locations in source files. The Quickfix window has to be manually opened using :copen. Instead, I like the Quickfix window to be automatically opened after running a :make.

This can be done by adding these line to .vimrc:

" Open Quickfix window automatically after running :make
augroup OpenQuickfixWindowAfterMake
    autocmd QuickFixCmdPost [^l]* nested cwindow
    autocmd QuickFixCmdPost    l* nested lwindow
augroup END

For more info, see this Vim Wiki entry.

Tried with: Vim 7.4 and Ubuntu 14.04

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s