10 years ago
Automatically opens the quickfix/location window after :make
, :grep
, :lvimgrep
and friends when there are errors/locations.
augroup qf autocmd! autocmd QuickFixCmdPost grep,make,grepadd,vimgrep,vimgrepadd,cscope,cfile,cgetfile,caddfile,helpgrep cwindow autocmd QuickFixCmdPost lgrep,lmake,lgrepadd,lvimgrep,lvimgrepadd,lfile,lgetfile,laddfile lwindow augroup END
Romain Lafourcade 10 years ago
@Konfect, no, :lgrep
only triggers one of the autocommands, here.
Konfekt 10 years ago
Ok. On my install (Linux, Vim 7.4.580) lmake
would trigger both lwindow
and cwindow
. Using ,
instead of \|
or the above pattern stopped that.
Romain Lafourcade 10 years ago
@Konfect, I'll take your ,
advice anyway. Thanks.
Konfekt 10 years ago
How about
autocmd QuickFixCmdPost l* lwindow autocmd QuickFixCmdPost [^l]* cwindow
instead? Also, currently
lgrep
would trigger both autocmd's because by\|
instead of,
the patterns are evaluated as regular expressions.