Over the last few days I’ve been evaluating Spacemacs as a replacement for Vim: I had already come to appreciate it because of its pleasant user experience and configurability but I was still missing a killer feature… Today I set out to explore Spacemacs’
scala configuration layer and guess what? I think I found one! By integrating with
ensime, Spacemacs gains IDE-level features such as: infer variable type, organize imports, extract method, rename variable, jump to definition, and many more… That’s incredibly better than my previous setup (
sbt running on the side)! Setting up a project for Ensime integration is straightforward:
- add ensime-sbt to your (global or local)
sbt gen-ensimeto generate the
SPC m n s).
Here are a few functions I find very useful:
||go to definition|
||inspect type at point|
||rename a symbol project wide|
||send buffer to REPL|
||send region of code to REPL|
||run quick tests|
Furthermore, while navigating a Scala file the current line’s method definition (or expression return type) will appear in the status bar.
For a complete list of features and keybindings, visit the official website.