• Stars
    star
    23
  • Rank 983,584 (Top 20 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created almost 5 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sublime Text plugin to run elm-format on save

Elm Format on Save

Run elm-format whenever you save an Elm file.

And add the keyboard shortcut Ctrl+K Ctrl+F (or Cmd+K Cmd+F on Mac) to run elm-format any time you want. No need to save.

Install

  1. Install elm-format
  2. Install Elm Syntax Highlighting for Sublime Text
  3. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) to open the Command Palette
  4. Select Package Control: Install Package
  5. Select Elm Format on Save

Try saving an Elm file to see if it works. You may see a panel open with troubleshooting advice if something has gone wrong!

Including/Excluding Files

Do you only want elm-format to run on certain files? (e.g. only work code)

Go to Sublime Text -> Preferences -> Package Settings -> Elm Format on Save -> Settings

You will see two panels. The left is all the defaults and the right is your custom overrides. So in the right panel, you can override the default settings with something like:

{
    "on_save": {
        "including": ["my/company/"],
        "excluding": ["src/generated/"]
    }
}

This would mean that you only run elm-format on code that is in the my/company/ directory, but you skip any files in the src/generated directory.

See the left settings panel for more information about how to include and exclude files!

Technical Details

This plugin works by modifying the code in the editor itself.

So when it runs "on save" it is specifically running before the file is saved to disk.

This is really important if you have some elaborate file watching system set up! Other plugins may format after the file is saved to disk, triggering a second save, and thereby degrading the performance of your file watching system.

More Repositories

1

elm-architecture-tutorial

How to create modular Elm code that scales nicely with your app
Elm
4,157
star
2

elm-todomvc

The TodoMVC app written in Elm, nice example for beginners.
Elm
1,216
star
3

start-app

DEPRECATED. Moved to elm-lang/html
Elm
393
star
4

elm-html

DEPRECATED. Moved to elm-lang/html
Elm
336
star
5

guide.elm-lang.org

My book introducing you to Elm!
Elm
311
star
6

elm-sortable-table

Sortable tables for whatever data you want to display
Elm
283
star
7

functional-programming-in-elm

DRAFT outlining some techniques of functional programming
Shell
227
star
8

airplane-mode

Airplanes are programming heaven. Airplane Mode turns off the bad internet. Yes docs, no facebook!
Python
120
star
9

url-parser

Parse URLs into nicely structured data
Elm
114
star
10

elm-playground

Create pictures, animations, and games with Elm!
Elm
106
star
11

elm-html-and-js

Example of how to integrate Elm with HTML and JS
HTML
93
star
12

react-angular-ember-elm-performance-comparison

Comparing performance of Elm, React, Angular, and Ember
JavaScript
91
star
13

elm-http

DEPRECATED. This library is now called elm-lang/http
Elm
89
star
14

elm-markdown

Markdown parsing within Elm
Elm
88
star
15

first-person-elm

First-person navigation in a simple 3D world, written in Elm
Elm
85
star
16

focus

A library for getting and setting values in deeply nested data structures.
Elm
80
star
17

TodoFRP

Basic Todo list example, written with FRP in Elm
Elm
75
star
18

elm-graphics

The graphical building blocks that inspired Elm in the first place
Elm
55
star
19

elm-effects

DEPRECATED. Moved to elm-lang/core
Elm
46
star
20

automaton

experimental library for Arrowized FRP in Elm
Elm
41
star
21

elm-svg

DEPRECATED. Moved to elm-lang/svg
Elm
30
star
22

time-zone-proposal

A proposal for accurately computing local time in JavaScript
29
star
23

elm-syntax-highlighting

Syntax Highlighting for Elm in Sublime Text
29
star
24

elm-hack-night

Elm
28
star
25

virtual-dom

DEPRECATED. Full rewrite in elm-lang/virtual-dom
JavaScript
25
star
26

local-channel

Helps you write self-contained components in Elm
Elm
16
star
27

elm-project-survey

How do build times and asset sizes change as Elm projects grow larger?
Haskell
12
star
28

task-tutorial

Friendly functions for getting started with tasks
JavaScript
11
star
29

elm-at-strangeloop

6
star
30

elm-at-mloc-js

Slides and resources from the mloc.js conference in Budapest! Graciously hosted by Prezi :)
5
star
31

elm-at-pldi-2013

A presentation written entirely in Elm, made for a talk at PLDI 2013.
Elm
4
star
32

codemesh-tutorial

self-contained exercises that emphasize fundamentals and the Elm Architecture
JavaScript
4
star
33

cufp-tutorial

Practice problems for the Elm tutorial at CUFP 2014
Elm
2
star