title: IntelliJ Idea compiling with SBT by default
body: <p>Let's say I have a <code>scala</code> code, opening in <code>intellij idea</code>:</p>
  
  <pre><code>object Test extends App {
                             // &lt;- I click here
    def init[T](xs: List[T]) : List[T] = xs match {
      case List() =&gt; throw new Error("empty list")
      case List(x) =&gt; List() // empty list 
      case head :: tail =&gt; head :: init(tail)
    }
  
    val list = List(1,2,4)
  
    println ( init(list) )
  
  }
  </code></pre>
  
  <p>Then, what I do when want to launch this code, I click between lines where <code>object</code> and <code>def</code> is defined to let <code>IDE</code> know what I want to launch (in this case whole object, because I do not select any method). Click <strong>CTRL+SHIFT+F10</strong> - to run. </p>
  
  <p>It starts.. I see "Test" in my configuration combo-box... But at that exact moment I stop compilation process .. and go to that configuration to change the config .. </p>
  
  <p>What I change: is <strong>"Before launch"</strong> section to make it run with <strong>"sbt:compile"</strong>. I do it because I want to <strong>rely on SBT but not on IDE</strong>.</p>
  
  <p>The question is: <strong>Is there a way to launch/compile in sbt by default in IntellyJ IDEA?</strong></p>