Scala Dev with Vim

After spending several hours spread across 2 or 3 days I've finally arrived at a (more or less) usable Scala Dev environment on Vim.

I've outlined my setup below!

Goals

  • Code Completion - Done
  • Syntax Highlighting - Done
  • :A access to tests (Alternates) - Pending

Guide

  1. Install Java 8 (I initially had 1.7 installed it was effectively unusable due to constant outOfMemory issues)

    # Update brew cask
    brew cask update
    # Install latest Java
    brew cask install java
    
  2. Install eclim

  3. Launch eclimd

    <eclipse_dir>/eclimd
    
  4. Install Typesafe Activator

  5. Create Scala Project

    activator new
    
  6. Add sbteclipse plugin

    # Add to <project_dir>/project/plugins.sbt
    addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")
    
  7. Create eclipse project with sbt

    sbt eclipse
    
  8. Import eclipse project with eclim

    # Within Vim
    :ProjectImport .
    

Notes

In my case I'm using YouCompleteMe, so I had to force eclim to integrate with omnifunc:

" In your .vimrc
let g:EclimCompletionMethod = 'omnifunc'  

Resources