1

I'm trying to hide the quickfix window while building, so that it doesn't show outdated info.

I can, of course, execute :ccl at any time to close quickfix. Additionally, I've used autocmd to call a function BeforeQuickFix which is successfully executed when prior to the execution of makeprg:

"hide quickfix when re-compiling
function BeforeQuickFix()
    :ccl
    :echom "hello test"
endfunction

autocmd QuickFixCmdPre * :call BeforeQuickFix()

However, while I see "hello test" printed prior to the execution of makeprg, the quickfix window never closes.

I've also tried to clear its contents instead with :cexpr [], but puzzlingly that also has no effect:

"hide quickfix when re-compiling
function BeforeQuickFix()
    :noautocmd cexpr []
endfunction

autocmd QuickFixCmdPre * :call BeforeQuickFix()

I'm sure I can manually hack at makeprg to get it to do what I want, but there has to be a cleaner way than that, right?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.