Whenever I run :make in Vim, it always takes control away from my buffer, places me in a temporary view where I see the makeprg's output and then prompts me to "Press ENTER or type command to continue". Is there a way so I can run :make without leaving my current buffer?

For context, I'm using pyunit to parse Python tracebacks, using make. WHen make is finished, it populates the traceback in my quickfix buffer. So I don't need to see the intermediary make output. Just the quickfix is all I want.

For context, I'm running something like this:

compiler pyunit
set makeprg=cat\ %

2 Answers 2


One way to do this natively in vim is to utilise system() or systemlist(). I'm not familiar with pyunit, but something like the following may help you get started.

function! MyMake() abort
    let l:efm = "%C %.%#,%A  File "%f"\, line %l%.%#,%Z%[%^ ]%\@=%m"
    let l:lines = systemlist("cat " . expand("%"))
    call setqflist([], " ", {"efm": l:efm, "lines": l:lines})
  • This got me really close but l:efm only matches a single line. It doesn't create individual entries for each function call. I went with let l:efm = '%A File "%f"\, line %l\, in %o,%C %m,%Z' and it works perfectly now. Thank you! Commented Feb 22, 2021 at 0:32

You can use tpope’s dispatch plugin and run :Make for an asynchronous make.

  • I tried this but unfortunately it doesn't work the same. Though I do use that plugin for other types of projects. Commented Feb 21, 2021 at 9:32
  • 1
    @ColinKennedy Can you expand on how it doesn't work the same? Which part of it doesn't work for you?
    – filbranden
    Commented Feb 21, 2021 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.