EditorConfig introduces a simple way to synchronize the coding style across different IDEs and editors. Basically, when you open a file, it will look for a .editorconfig
-file in the same directory and every parent directory until one is found. It then parses the file and applies the settings to your editor. Simple, eh?
The syntax is simple and the settings fairly self-explanatory. Here’s an example .editorconfig
from one of my projects:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | [code language="ini"] root = true [*] indent_style = space indent_size = 4 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [/code] |
There are plugins available for many of the most popular editors and IDEs such as Vim, Emacs, Sublime Text, TextMate etc. Take a look at the official page for a full listing.
My advice: Install the plugin for your editor today and create an .editorconfig for your projects.