Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some updates to help me work in Scala

  • Loading branch information...
commit 49cb781901579ddecc02151721a45bb8ded9f771 1 parent 578cbfd
Derek Wyatt authored
Showing with 25 additions and 2 deletions.
  1. +6 −0 ftplugin/scala.vim
  2. +19 −2 xpt-personal/ftplugin/scala/scala.xpt.vim
6 ftplugin/scala.vim
View
@@ -18,6 +18,12 @@ if !exists("*s:CodeOrTestFile")
elseif current =~ "/app/model/"
let other = substitute(current, "/app/model/", "/test/", "")
let other = substitute(other, ".scala$", "Spec.scala", "")
+ elseif current =~ "/app/controllers/"
+ let other = substitute(current, "/app/", "/test/scala/", "")
+ let other = substitute(other, ".scala$", "Spec.scala", "")
+ elseif current =~ "/test/scala/controllers/"
+ let other = substitute(current, "/test/scala/", "/app/", "")
+ let other = substitute(other, "Spec.scala$", ".scala", "")
elseif current =~ "/test/"
let other = substitute(current, "/test/", "/app/model/", "")
let other = substitute(other, "Spec.scala$", ".scala", "")
21 xpt-personal/ftplugin/scala/scala.xpt.vim
View
@@ -133,6 +133,23 @@ case object `objectName^
XPT case hint=Creates\ a\ case\ statement
case `matchAgainst^ =>
+XPT akkamain hint=Creates\ a\ simple\ Akka\ App\ for\ PoC
+import akka.actor._
+
+class MyActor extends Actor {
+ def receive = {
+ case _ =>
+ }
+}
+
+object Main {
+ val sys = ActorSystem()
+ def main(args: Array[String]) {
+ val a = sys.actorOf(Props[MyActor], "MyActor")
+ `cursor^
+ }
+}
+
XPT specfile hint=Creates\ a\ new\ Specs2\ test\ file
`getPackageLine()^
@@ -167,12 +184,12 @@ XPT wst hint=Creates\ a\ new\ WordSpec\ test
`cursor^
} //}2
-XPT wordspecgroup hint=Creates\ a\ new\ WordSpec\ test\ group
+XPT groupwordspec hint=Creates\ a\ new\ WordSpec\ test\ group
"`spec^" should { //{1
`cursor^
} //}1
-XPT wordspecfile hint=Creates\ a\ new\ WordSpec\ test\ file
+XPT filewordspec hint=Creates\ a\ new\ WordSpec\ test\ file
import org.scalatest.{WordSpec, BeforeAndAfterEach, BeforeAndAfterAll}
import org.scalatest.matchers.MustMatchers
Please sign in to comment.
Something went wrong with that request. Please try again.