sponsor Vim development Vim logo Vim Book Ad

Erroneous : The right way to handle errors

 script karma  Rating 6/3, Downloaded by 2162  Comments, bugs, improvements  Vim wiki

created by
Idan Arye
script type
GitHub repository: https://github.com/idanarye/vim-erroneous

Erroneous is a plugin for handling errors from external programs. Vim provides you with the :make command to run compilers and parse the errors using the 'errorformat' option, but you must set the 'errorformat' option in advance. If you use more than one language regularly, you'll have to change 'errorformat' often. This is usually done with file-type plugins - but that means you have to always compile from one of the source files(you can't, for example, compile from one of the configuration XML files). You can also set a long, compound 'errorformat' that can catch errors in many formats - but from my experience those catch-all 'errorformat's tend to identify error-description lines as error headlines and create entries in the quickfix list that are mapped to nowhere and send you to empty buffers. Not as fun as it sounds...

Erroneous takes a different approach - instead of parsing stderr based on the filetype, parsing is done based on the shell command that invoked the program that created the error. So, if you run javac MyClass.java Erroneous will automatically set the 'errorformat' to parse javac errors, while running gcc main.c will cause Erroneous to set 'errorformat' to parse gcc errors.

Erroneous can also read shebangs to know how to parse errors of interepted scripts in linux, and it provides API for other plugins that want to determine the error format by other means.
install details
After extracting the zip/cloning from GitHub, you need to set the g:erroneous_errorFormatChooserPatterns and/or the g:erroneous_errorFormatChooserWords dictionaries. See ":help erroneous-configurations" for instructions how to do that.

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
erroneous_v1.3.0.zip 1.3.0 2017-12-01 7.3 Idan Arye Add an Omnipytent extension module
erroneous_v1.2.0.zip 1.2.0 2014-08-12 7.0 Idan Arye Add Waf support
erroneous_v1.1.1.zip 1.1.1 2014-08-08 7.0 Idan Arye Use IO.select to improve speed of Ruby implementation
erroneous_v1.1.0.zip 1.1.0 2013-12-02 7.0 Idan Arye * Added erroneous#parseXBuildErrorOutput for handling XBuild and MSBuild.
* Can now read the shell exit code even without Ruby, so you no longer need Ruby support to run Maven(with Ruby it's still more awesome though).
erroneous_v1.0.0.zip 1.0.0 2013-02-12 7.3 Idan Arye Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
Vim at Github