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

Editor​Config

by sindresorhus ALL Top 100

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

Details

  • 2020.03.11.10.22.01
  • github.​com
  • github.​com
  • 4 weeks ago
  • 3 hours ago
  • 8 years ago

Installs

  • Total 186K
  • Win 70K
  • Mac 79K
  • Linux 37K
Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 29 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24
Windows 29 25 24 23 16 9 24 34 34 35 43 22 34 36 36 21 39 30 22 14 25 30 35 34 27 15 26 25 36 29 20 27 14 16 34 30 36 38 38 23 9 23 25 34 23 23
Mac 18 19 22 16 12 13 26 8 19 20 18 15 13 12 20 17 23 13 14 13 20 17 17 24 29 10 19 16 21 41 17 10 11 8 13 23 30 25 22 15 8 18 25 33 22 16
Linux 5 12 28 21 17 28 13 16 12 16 14 6 15 17 20 18 14 17 11 10 15 13 14 15 18 7 12 11 14 14 10 16 9 10 11 13 10 18 16 8 8 10 9 16 21 23

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