Table of contents

I love Sublime Text, and whilst I do use IntelliJ for some of my Scala development,
I do find myself using Sublime more and more. And with that it is nice to have proper syntax highlighting and even compilation errors inside Sublime.

Enter Ensime, the ENhanced Scala Interaction Mode for Emacs, except I use it with Sublime.
Sprinkle some other helpful plugins and we have a lightweight but powerful development environment.

Install Sublime Text

You probably already have Sublime installed, but if not go to Sublime Text's website and download the appropriate version. Currently version 3 is the valid version even though it is technically still called beta.

Install it via your normal OS installation method.

Note: Sublime Text is not open source nor free, whilst you can keep using it for free it will nag you to purchase the full version.

Ensime plugins for exists for other editors as well, Atom, Emacs and Vim.

Note Ensime requires you project to be using SBT 0.13.5 or later.
(check your project's project/build.properties)

Install Ensime for Sublime

For older versions you cloned the sublime-ensime package into Sublime's package folder.
And a whole lot more.
(~/Library/Application\ Support/Sublime\ Text\ 3/Packages or ~/.config/sublime-text-3/Packages)

But the current versions are all available via Sublime's package manager.
Ensure you have package manager installed.
In Sublime open the package manager's install package menu by pressing cmd+shift+p in OSX or ctrl+shift+p in Linux,
and look for "Install packges". In its dropdown search for and select Ensime.

Start Ensime

You no longer need to launch external scripts or configure anything,
simply open Sublime's command palette (cmd/ctrl+shift+p) and find and run Ensime: Startup

Note this may take a little awhile. Logs are available to debug what is going on.
This is usually the point you realise you missed a step or typoed somewhere...

Use Ensime

Ensime will now highlight compilation errors.

If you right click a method/variable and right click Ensime/Development/Go to definition, you can navigate your code as an IDE.
Keyboard shortcuts make this quicker.