I use Vim/gVim for programming in javascript (node). I have jslint wired up as makeprg in my filetype plugin. Here's errorformat:
efm=%-P%f,
\%A%>%\\s%\\?#%*\\d\ %m,%Z%.%#Line\ %l\\,\ Pos\ %c,
\%-G%f\ is\ OK.,%-Q
And here is the output of jslint:
routes/pcr.js
#1 'db' was used before it was defined.
db.collection('pcrs', function (err, collection) { // Line 11, Pos 5
#2 'db' was used before it was defined.
db.collection('pcrs', function (err, collection) { // Line 23, Pos 5
#3 'BSON' was used before it was defined.
collection.findOne({'_id': new BSON.ObjectID(id)}, function (err, item) { // Line 24, Pos 40
And here is the output to the quickfix window:
routes/pcr.js|11 col 5| 'db' was used before it was defined.
routes/pcr.js|23 col 5| 'db' was used before it was defined.
routes/pcr.js|24 col 40| 'BSON' was used before it was defined.
After the column number, I'd like to left pad that out to say 2 digits (I hope a file has no more than 99 errors!) so that it looks like:
routes/pcr.js|11 col 5| 'db' was used before it was defined.
routes/pcr.js|23 col 5| 'db' was used before it was defined.
routes/pcr.js|24 col 40| 'BSON' was used before it was defined.
I guess this would also affect line numbers 0-9 as well. Is it possible to conditionally pad the output?
:help quickfix-window
mentions about reformatting of error lists.The following setting works for me(update):