Skip to content

Instantly share code, notes, and snippets.

Previously, I played with a way of piping output from SBT into a file that would be truncated on each compile session: https://gist.github.com/nkpart/5923908 . After that, I used cfile to load up the errors in that file.

However, as is so often the case, it turns out most of the plumbing is already there in SBT and VIM and a great solution is trivial.

When SBT runs, it logs each tasks' output into target/streams/<task>. We can use the output stream from compile as the input to cfile, without any of that haskell scripting nonsense!

:cfile ./target/streams/compile/compile/\$global/out

The only other part you need is a nice errorformat value. This setting tells vim how to pull errors out of the parameter to cfile. The one from Derek Wyatt's vim-scala project works:

@AitorATuin
AitorATuin / Server.scala
Last active January 22, 2016 19:54 — forked from YoEight/Server.scala
Chunk encoded response using Unfiltered, Netty and Scalaz-Stream
package deiko
import java.nio.charset.Charset
import java.util.concurrent.CancellationException
import org.jboss.netty.buffer.ChannelBuffers
import org.jboss.netty.channel.{ Channel, ChannelFuture, ChannelFutureListener }
import org.jboss.netty.handler.codec.http.{ DefaultHttpChunk, HttpChunk }
import scalaz.stream.{ Process, process1, processes }
import scalaz.concurrent.Task
import Process.{ Process1, Sink }
@AitorATuin
AitorATuin / gist:61d9d5c024cf781cbacd
Last active August 29, 2015 14:26 — forked from runarorama/gist:a8fab38e473fafa0921d
Compositional application architecture with reasonably priced monads
sealed trait Interact[A]
case class Ask(prompt: String)
extends Interact[String]
case class Tell(msg: String)
extends Interact[Unit]
trait Monad[M[_]] {
def pure[A](a: A): M[A]

Using Yeoman and Jade

Getting started

  • Make sure you have yo installed: npm install -g yo
  • Run: yo webapp
  • Install grunt-contrib-jade: npm install grunt-contrib-jade --save-dev

Customization