All Projects → evancz → elm-format-on-save

evancz / elm-format-on-save

Licence: BSD-3-Clause license
Sublime Text plugin to run elm-format on save

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to elm-format-on-save

Sublime Rails Snippets
Sublime Text snippets for the latest Ruby and Rails versions
Stars: ✭ 406 (+2155.56%)
Mutual labels:  sublime-text, editor-plugin
zephir-sublime
Sublime Text syntax highlighting for for Zephir
Stars: ✭ 41 (+127.78%)
Mutual labels:  sublime-text, editor-plugin
elm-syntax-highlighting
Syntax Highlighting for Elm in Sublime Text
Stars: ✭ 27 (+50%)
Mutual labels:  sublime-text, editor-plugin
Sublimelinter Contrib Xo
SublimeLinter plugin for XO
Stars: ✭ 53 (+194.44%)
Mutual labels:  sublime-text, editor-plugin
GoDebug
Go debugger (Delve) integration with Sublime Text 3
Stars: ✭ 20 (+11.11%)
Mutual labels:  sublime-text
TwoDark
Atom's OneDark inspired theme for Sublime Text
Stars: ✭ 19 (+5.56%)
Mutual labels:  sublime-text
sublime-import-helper
A Sublime Text Plugin that helps you to import your modules.
Stars: ✭ 69 (+283.33%)
Mutual labels:  sublime-text
sublime-simple-import
A Sublime Text Plugin that helps you to import your modules.
Stars: ✭ 15 (-16.67%)
Mutual labels:  sublime-text
sublime
🧛🏻‍♂️ Dark theme for Sublime Text
Stars: ✭ 87 (+383.33%)
Mutual labels:  sublime-text
docs.sublimetext.io
Sublime Text Community Documentation
Stars: ✭ 145 (+705.56%)
Mutual labels:  sublime-text
Sublime-Fanhuaji
繁化姬的 Sublime Text 插件
Stars: ✭ 48 (+166.67%)
Mutual labels:  sublime-text
elm-lint
elm-lint lints Elm source code, to add additional guarantees to your project.
Stars: ✭ 27 (+50%)
Mutual labels:  elm-format
ST-OpenUri
The ultimate Sublime Text plugin for opening URIs (URLs) in your file.
Stars: ✭ 25 (+38.89%)
Mutual labels:  sublime-text
knowledge
Everything that you need. 💡 📚 🔭
Stars: ✭ 26 (+44.44%)
Mutual labels:  sublime-text
sublime-color-scheme-unit
A testing framework for Sublime Text color schemes.
Stars: ✭ 19 (+5.56%)
Mutual labels:  sublime-text
LegacyColorSchemes
Color schemes that were part of Sublime Text 2 and older builds of Sublime Text 3
Stars: ✭ 48 (+166.67%)
Mutual labels:  sublime-text
HiveOpener
A Sublime Text 2/3 plugin to quickly open file, directory and url
Stars: ✭ 24 (+33.33%)
Mutual labels:  sublime-text
sublime-applescript
AppleScript command completions, build system and useful snippets. Supports editing binary scripts
Stars: ✭ 50 (+177.78%)
Mutual labels:  sublime-text
Ciapre.tmTheme
Ciapre - an easy-on-the-eyes Sublime Text/TextMate color scheme.
Stars: ✭ 63 (+250%)
Mutual labels:  sublime-text
simple-ftp-deploy
This package for Sublime Text 3 give you possibility to auto upload file to FTP server when you save local file.
Stars: ✭ 16 (-11.11%)
Mutual labels:  sublime-text

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].