In combination with SBT ~[action]
, this script will populate an errors file with any errors at the end of each compile session. I think it's a neat example of the State monad and some simple regular expressions.
The output of SBT needs to be run through the script. Using tee
allows you to still see the output in your terminal. User interaction with SBT is unaffected too, woo!
$ sbt ~compile | tee >(runhaskell Sbt.hs)
Then in VIM, just call :cfile
, which will (by default) load up 'errors.err' into the quickfix list.
You can also supply an output file as an argument:
$ sbt ~compile | tee >(runhaskell Sbt.hs my_errors)
:cfile my_errors