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

  • 2019.09.23.10.20.22
  • github.​com
  • github.​com
  • 4 months ago
  • 1 hour ago
  • 8 years ago

Installs

  • Total 183K
  • Win 68K
  • Mac 78K
  • Linux 36K
Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13
Windows 25 12 18 13 23 22 36 28 13 13 26 19 32 32 35 21 22 28 32 40 30 33 17 20 34 21 12 18 22 15 11 19 23 20 17 18 9 10 19 21 24 38 37 22 13 21
Mac 16 7 15 15 22 23 20 14 9 14 16 24 26 29 25 8 17 21 21 29 37 27 12 9 15 14 9 10 17 8 10 15 10 7 12 22 13 13 12 15 16 25 13 12 14 15
Linux 12 10 14 14 13 17 18 11 14 9 17 16 16 8 13 13 10 13 15 17 16 16 13 8 8 11 7 3 9 7 7 8 13 6 10 9 9 5 16 12 7 9 11 5 6 16

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.