derekwyatt/vim-scala — pull request #12 by mmorearty (2012-10-27 03:53:26+00:00)
Title: Auto-detect *.sbt and "#!/usr/bin/env scala"

Auto-detect *.sbt (Scala Build Tool) files and files whose first line is `#!/usr/bin/env scala` as Scala.

Scala allows a "shebang" line to write scripts in Scala and have the shell execute them automatically, as long as the `#!` line is followed by a `!#` line. E.g. you could write a file called `myscript` that looks like this:

#!/usr/bin/env scala
!#

// your Scala code goes here

Even though the filename does not end with `.scala`, with this patch, the shebang line will be detected and the `filetype` will be set to `scala`.