in Programming

Cross-editor coding style with EditorConfig

EditorConfig is a standard that helps developers define consistent coding styles between different editors and IDEs. Put a file in the root of your project called .editorconfig, and when someone opens a file in a supported text editor, the editor will adhere to the project’s style rules. There are EditorConfig plugins for pretty much every text editor. I use this plugin for SublimeText.

Drop an .editorconfig file in the root of your project:

root = true

indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

trim_trailing_whitespace = false

You can install EditorConfig for Sublime with Package Control in just a few seconds.

editorconfig - SublimeText