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
  • 2 months ago
  • 46 minutes ago
  • 5 years ago

Installs

  • Total 118K
  • Win 40K
  • OS X 55K
  • Linux 23K
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 13 47 69 57 25 36 49 57 57 61 49 29 21 61 61 71 52 71 31 20 40 58 61 74 51 29 23 62 52 65 65 55 33 29 40 65 48 63 57 24 18 46 50 44 63 52
OS X 12 56 81 69 24 32 69 64 72 62 75 25 25 58 63 70 56 84 31 29 57 91 94 69 70 26 30 60 67 80 84 70 28 32 48 60 60 68 71 20 25 56 52 60 71 64
Linux 7 28 27 27 16 21 22 28 24 40 33 15 17 34 31 26 28 30 15 19 31 24 38 32 28 19 15 32 17 24 30 33 13 16 37 24 38 31 21 12 15 32 31 31 28 34

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