This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/contrib/lang/scala
syl20bnr ceefe88b75 Update CONTRIBUTE.md and add file headers
Also add default file header to layer templates.
2015-01-13 23:12:56 -05:00
..
img Move layer images into img directories 2014-12-24 01:03:49 -05:00
funcs.el Update CONTRIBUTE.md and add file headers 2015-01-13 23:12:56 -05:00
packages.el Update CONTRIBUTE.md and add file headers 2015-01-13 23:12:56 -05:00
README.md readme 2014-12-30 11:40:43 +13:00

Scala contribution layer for Spacemacs

logo

Table of Contents

Description

This layer adds support for the Scala language using the excellent ENSIME client/server.

Install

Add this contribution to your ~/.spacemacs.

(setq-default dotspacemacs-configuration-layers '(scala)
  "List of contribution to load."
)

Ensime

ENSIME provides IDE-like features, such as refactoring, incremental compilation and project-wide type-checking.

ENSIME requires a configuration file at the root of each Scala project. It provides an SBT plugin to generate these files.

Installation

  1. Configure the ENSIME sbt plugin by adding the following to ~/.sbt/0.13/plugins/plugins.sbt:

    resolvers += Resolver.sonatypeRepo("snapshots")
    
    addSbtPlugin("org.ensime" % "ensime-sbt" % "0.1.5-SNAPSHOT")
    
  2. Run sbt at the shell to download and install the plugin.

See the ENSIME quickstart guide for further information.

Usage

  1. Create a .ensime file at the root of your Scala project using sbt gen-ensime at the shell.

  2. Run M-x ensime within Emacs to start an ENSIME session.

Each Scala project uses a dedicated ENSIME session, so you only need to run M-x ensime once per project. Any Scala files you create or visit within the project will automatically use ENSIME for the remainder of your editing session.

Scalastyle

Scalastyle provides style-checking and linting. The Emacs functionality is provided by Flycheck.

To use scalastyle,

  1. Download the scalastyle jar and put it somewhere sensible
  2. Customise the flycheck-scalastyle-jar variable and set it to the path of the jar.

See the flycheck documentation for up-to-date configuration instructions.