ようやくsasscを自前でビルドして使うようにしたので、Vimのコンパイラー・プラグインも書いた。sasscをプロダクション環境で使うことはまだないが、エディターなどでオン・ザ・フライでコンパイルする時には速度がモノをいうので積極的に使いたい。

if exists("current_compiler")
  finish
endif
let current_compiler = "sass_scss"

if exists(":CompilerSet") != 2 " older Vim always used :setlocal
  command -nargs=* CompilerSet setlocal <args>
endif

let s:cpo_save = &cpo
set cpo&vim

CompilerSet makeprg=sassc\ %\ %:s?\.scss$?.css?

CompilerSet errorformat=
      \%EError:\ %m,
      \%Z\ \ \ \ \ \ \ \ on\ line\ %l\ of\ %f,
      \%-G%.%#

let &cpo = s:cpo_save
unlet s:cpo_save

たまにしか書かないので、複数行のerrorformatの書き方をすぐ忘れる。GNU Error Formatで出せとは言わないが、出せるオプションを用意することをセケンに強要したい。