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

Editor​Config

by sindresorhus ST2/ST3 Top 100

Helps developers maintain consistent coding styles between different editors - Sublime Text plugin

Details

  • 2017.06.09.15.13.24
  • github.​com
  • github.​com
  • 4 months ago
  • 1 hour ago
  • 5 years ago

Installs

  • Total 124K
  • Win 43K
  • OS X 57K
  • Linux 24K
Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10
Windows 40 29 49 80 63 91 83 46 42 73 104 79 58 38 27 26 47 60 76 69 39 19 34 42 52 51 33 40 21 33 53 37 61 62 54 18 22 44 50 68 40 44 29 43 47 43
OS X 36 39 76 76 58 81 83 29 49 98 168 123 76 60 21 40 43 59 71 61 50 23 23 57 58 51 39 53 28 22 56 67 58 68 44 27 19 52 55 43 71 53 18 32 56 62
Linux 17 23 25 31 33 45 36 17 19 47 54 44 25 29 15 20 23 29 30 27 31 22 13 22 25 33 24 17 14 22 29 15 24 30 21 15 14 30 21 32 20 24 16 11 20 24

Readme

Source
raw.​githubusercontent.​com

EditorConfig

EditorConfig helps developers maintain consistent coding styles between different editors


🦄

Support this project & level up your Sublime skills with this excellent Sublime Power User course by Wes Bos
Try his free JavaScript 30 course for a taste of what to expect. Also check out his ES6 and React course.

🌈


Install

Install EditorConfig with Package Control and restart Sublime.

Getting started

See the EditorConfig site for documentation.

Supported properties

  • root
  • indent_style
  • indent_size
  • end_of_line
  • charset
  • trim_trailing_whitespace
  • insert_final_newline

Explanation of the properties can be found on the EditorConfig site.

Example file

My recommended default settings

# editorconfig.org
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

Tips

EditorConfig snippet

If you can't remember all settings managed by the EditorConfig file, you'll love the editorconfig snippet.

Just type editorconfig + tab, and your editor will focus on the first setting's value (indent_style = lf). You can change the value, if you want, and jump to the next setting's value by hitting tab and so on. Settings are somewhat autocompleted, and if you don't remember all possible values, simply remove the setting value to see them all as a comment.

You can be in a context where editorconfig + tab trigger another snippet. In that case, simply use Goto anywhere (Ctrl + P on Linux/Windows or + P on macOS), type editorconfig, select Snippet: editorconfig and hit Enter.

View active config

The active config is printed in the Sublime console.

Trailing whitespace

Even though there is a trim_trailing_whitespace property. I would still recommend you set "draw_white_space": "all" and/or "trim_trailing_white_space_on_save": true in your Sublime preferences to prevent you from accidentally committing whitespace garbage whenever a project is missing a .editorconfig file.

Show changes

This plugin does its changes transparently in the background. I would recommend the excellent Modific plugin if you would like to see what changed.

License

MIT © Sindre Sorhus