I added a custom errorformat in my .vimrc like this:

set errorformat+=ERROR:\ %f:%l:%c:\ error:\ %m

However, this doesn't work because an already existing format is matched first (incorrectly). In order to prioritize my own format I'd like to add it to the beginning of the errorformat list but haven't found a way to do so. I checked :h list but that didn't help or maybe I'm looking in the wrong spot. How can I achieve this?

  • :h set^= maybe?
    – Maxim Kim
    Commented Feb 16, 2022 at 9:28
  • @MaximKim Yes, that's it. Thank you very much!
    – lelgetrekt
    Commented Feb 16, 2022 at 9:56
  • @MaximKim let's turn that into an answer :)
    – D. Ben Knoble
    Commented Feb 16, 2022 at 19:58

1 Answer 1


Use set errorformat^=ERROR:\ %f:%l:%c:\ error:\ %m

For string option ^= would prepend given value to existing one.

See :h set^= for reference.

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.