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

  • 2018.12.27.13.16.51
  • github.​com
  • github.​com
  • 5 months ago
  • 3 hours ago
  • 7 years ago

Installs

  • Total 171K
  • Win 63K
  • OS X 74K
  • Linux 33K
May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7
Windows 27 28 20 20 19 25 25 29 22 33 15 20 11 36 31 36 26 20 15 19 24 15 29 43 19 16 30 25 28 36 25 18 12 30 28 31 25 39 11 24 34 39 37 35 45 18
OS X 13 34 24 14 13 23 24 37 27 35 10 15 22 22 21 33 23 18 15 23 24 21 31 26 15 13 17 27 25 21 24 21 12 28 23 22 32 27 9 15 14 26 28 38 33 21
Linux 13 14 15 10 11 15 20 14 12 8 9 5 14 13 19 12 20 7 10 21 11 11 19 20 11 11 13 15 11 16 16 14 12 24 17 19 17 16 14 11 14 16 20 18 21 10

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

root = true

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

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