Minimal Sublime Text 3 package to format Scala files, powered by Scalafmt and Nailgun.
... with Package Control
- open the Command Palette
- select
Package Control: Install Package
- select
Scalafmt
Clone this repository in ~/Library/Application Support/Sublime Text 3/Packages/
.
Run provided setup.sh
, that will install for you both Scalafmt and Nailgun according to recommended installation instructions.
Open Preferences > Key Bindings
and add:
{
"keys": ["super+alt+l"],
"command": "scalafmt_format_file",
}
changing keys
to any sequence of keys you'd like.
Open a Scala file, then open the Command Palette
and select Scalafmt: Format current file
.
This package uses (and creates, if missing) ~/.scalafmt.conf
: this file can be used to influence how scalafmt
formats your code.
Only developed and tested on macOS.