ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Elm Language Support

by elm-community ST2/ST3

Elm language syntax highlighting and tool integration for ST2/3.

Details

Installs

  • Total 16K
  • Win 4K
  • OS X 9K
  • Linux 3K
Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12
Windows 0 3 2 3 3 7 2 1 6 5 4 3 7 3 4 6 2 12 2 3 5 7 2 3 4 2 5 6 6 10 4 5 2 1 6 9 10 2 8 4 6 5 4 5 2 7
OS X 0 7 8 7 3 12 6 2 12 10 10 3 5 11 5 9 10 8 3 9 10 8 8 7 9 9 4 10 12 8 12 5 5 1 8 10 14 5 6 1 5 12 14 17 13 9
Linux 1 5 4 7 1 3 2 3 6 7 2 2 2 3 3 1 4 7 3 4 7 5 6 11 6 5 7 5 4 9 3 7 1 1 3 2 4 2 1 4 3 1 2 1 2 8

Readme

Source
raw.​githubusercontent.​com

Elm Language Support logo

The Sublime Elm Language Package

Installation

  1. Install Package Control
  2. Run Package Control: Install Package in the Command Palette (Super+Shift+P)
  3. Install Elm or use NPM (npm i -g elm)

Features

  • Compatible with Sublime Text 2 and Sublime Text 3
  • Syntax highlighting
  • Snippets for common Elm syntax (function, caseof, letin, etc.)
Tab Trigger Description
cof case … of
cofm case … of (Maybe)
cofr case … of (Result)
fn Function (a -> b)
fn2 Function (a -> b -> c)
fn3 Function (a -> b -> c -> d)
fn4 Function (a -> b -> c -> d -> e)
imp import
impas import … as
let let … in …
mod module
type type
typea type alias (Record)
  • Autocompletions plus type signature and documentation display for all functions inside packages in your elm-package.json file (requires elm-oracle, which you can install with npm install -g elm-oracle)
    1. Bring up the type panel with alt+up or through the right-click context menu
    2. Close the type panel with alt+down
    3. If you don't like these keybindings, rebind them in your User packages directory autocompletions screenshottype signature screenshottype panel screenshot
  • Four standard build commands (Super+[Shift]+B or Super+[Shift]+F7)
    1. Build just checks errors. Kudos to this tweet!
    2. Run additionally outputs your compiled program to an inferred path.
    3. The same as the above two, but ignoring warnings
    4. Output path is configurable in elm-package.json or Elm Build System: … in the Command Palette. Elm build system only requires a valid config in any ancestor directory of the active file. compile messages screenshot
  • Compile messages
    1. Navigate errors and warnings (Super+[Shift]+F4).
    2. Formatted for build output panel.
    3. Compile message highlighting, embedded code highlighting, and color scheme for output panel. compile messages screenshot
  • Integration with popular plugins (installed separately)
    1. SublimeREPL — Run elm-repl in an editor tab with syntax highlighting. SublimeREPL screenshot
    2. Highlight Build Errors — Does what it says on the box … usually.
  • Integration with elm format
    1. Make sure elm-format is in your PATH
    2. Run the “Elm Language Support: Run elm-format” command from the Command Palette to run elm-format on the current file
    3. To enable automatic formatting on every save, Go to Preferences -> Package Settings -> Elm Language Support -> Settings and add this setting: "elm_format_on_save": true
    4. If there are certain Elm source files you don't want to automatically run elm-format on, for example elm-css based files, you can set a regex filter which will search the full filename (including the path to the file). If the regex matches, then it will not automatically run elm-format on the file when you save. For example, the following filter would prevent automatic elm-format on a file named elm-css/src/Css/TopBar.elm: "elm_format_filename_filter": "elm-css/src/Css/.*\\.elm$"elm-format screenshot

Troubleshooting

  • I have elm-oracle installed, but completions, type signature display, and the type panel don't work
    1. Make sure elm-oracle is on your PATH, or
    2. Add the absolute path of the directory containing elm-oracle to the elm_paths setting in your Elm Language Support User settings
  • I have elm-format installed, but it's not working
    1. Make sure elm-format is on your PATH, or
    2. If using an alternate name for the binary (elm-format-0.17 or elm-format-0.18) add it to the elm_format_binary setting in your Elm Language Support User settings; an example might be "elm_format_binary": "elm-format-0.18",, or
    3. Add the absolute path of the directory containing elm-format to the elm_paths setting in your Elm Language Support User settings. Note that you can combine paths with the above, so an example might be "elm_paths": "/users/alex/elm-format:/users/alex/elm-oracle"
  • Elm format automatically runs every time I save a file, but there are some files I don't want it to run on
    1. If there are certain Elm source files you don't want to automatically run elm-format on, for example elm-css based files, you can set a regex filter which will search the full filename (including the path to the file). If the regex matches, then it will not automatically run elm-format on the file when you save. For example, the following filter would prevent automatic elm-format on a file named elm-css/src/Css/TopBar.elm: "elm_format_filename_filter": "elm-css/src/Css/.*\\.elm$"

Learning

Don't know Elm? Great first step!