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
  • 1 year ago
  • 42 minutes ago
  • 6 years ago

Installs

  • Total 149K
  • Win 53K
  • OS X 67K
  • Linux 29K
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 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 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
Windows 25 30 46 60 56 51 35 38 25 47 56 48 51 49 34 24 48 24 63 77 50 36 34 50 60 62 59 41 25 36 54 38 50 68 59 27 46 43 50 58 60 77 28 30 52 52
OS X 16 20 38 41 57 60 42 10 15 31 51 40 52 50 14 22 38 23 52 47 45 26 21 53 46 52 44 40 19 19 42 40 50 52 39 22 29 53 49 55 62 61 13 31 53 50
Linux 9 15 16 22 25 21 24 11 7 20 14 16 17 20 6 13 20 8 17 32 20 27 15 30 20 19 23 16 19 8 22 29 24 32 21 15 16 34 21 29 31 32 14 12 23 28

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