I have been learning about quickfix recently, trying to make it work well with pytest to that end I provided my own makeprg and efm. So far everything is great except that pytest frequently traces error back to a library that I use within my project and when I run :make vim open a new buffer of file in that 3rd party library.

What I'd like to do is make vim ignore error paths that are not in my project, which in case of pytest happen to be error that start with absolute path rather than relative one.

Is that possible?

Not sure if this is of any relevance to this but this is my efm %f:%l:\ %m


1 Answer 1


There is a marker to ignore a matched file: %-G (see :help efm-ignore).

As you want to ignore a line that contains an absolute path, just ignore anything matching /.*. For errorformat this is written as /.%#.

Combined together:

:set errorformat=%-G/.%#,%f:%l:\ %m

If you are on Windows, maybe the following (can't test):

:set errorformat=%-G.:\\.%#,%f:%l:\ %m
  • took we a while to test this out but works like a charm, now my quickfix looks much cleaner
    – sgp667
    Commented May 28, 2019 at 19:17

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.