Elm Format on Save
Sublime Text plugin to run elm-format on save
Details
Installs
- Total 4K
- Win 2K
- Mac 1K
- Linux 822
Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | Dec 14 | Dec 13 | Dec 12 | Dec 11 | Dec 10 | Dec 9 | Dec 8 | Dec 7 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
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
- Install
elm-format
- Install Elm Syntax Highlighting for Sublime Text
- Press
Ctrl+Shift+P
(orCmd+Shift+P
on Mac) to open the Command Palette - Select Package Control: Install Package
- 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.