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

  • 2016.06.14.15.56.54
  • github.​com
  • github.​com
  • 9 months ago
  • 2 hours ago
  • 5 years ago

Installs

  • Total 103K
  • Win 34K
  • OS X 49K
  • Linux 20K
Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 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
Windows 53 65 67 62 57 25 42 59 67 56 62 66 33 40 58 59 66 74 64 24 52 37 44 47 36 50 22 40 50 38 54 57 54 44 43 56 70 65 67 58 33 35 51 42 72 49
OS X 63 70 94 69 85 35 42 59 87 65 66 81 21 34 62 73 79 79 75 27 30 56 85 77 64 74 35 28 54 61 74 79 101 30 32 62 69 66 101 88 43 41 72 76 80 99
Linux 36 27 31 33 34 16 18 26 38 38 37 38 25 16 34 27 38 25 27 18 19 22 34 49 51 29 20 17 29 28 38 32 19 20 16 25 26 36 27 34 24 15 22 37 36 27

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.

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