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

Editor​Config

by sindresorhus ALL

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

Details

Installs

  • Total 219K
  • Win 83K
  • Mac 91K
  • Linux 44K
Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30
Windows 1 3 3 8 4 4 4 6 3 3 2 3 3 3 5 5 2 0 0 0 0 0 5 9 2 2 5 5 3 4 0 0 5 5 6 6 4 9 6 3 6 5 6 4 5 5
Mac 1 4 2 5 4 1 3 3 1 8 4 3 5 1 2 4 1 0 0 0 0 4 3 7 1 2 7 4 3 5 0 0 8 4 7 5 6 0 4 4 4 6 2 5 4 4
Linux 1 1 3 8 3 3 4 4 2 3 2 3 4 3 0 4 2 0 0 0 1 9 2 4 3 3 2 5 5 1 0 0 4 11 2 4 2 2 3 4 5 4 4 2 3 4

Readme

Source
raw.​githubusercontent.​com

EditorConfig

EditorConfig helps developers maintain consistent coding styles between different editors

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.

The tab_width property is intentionally not supported.

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 settings to prevent you from accidentally committing whitespace garbage whenever a project is missing a .editorconfig file.