EditorConfig to the Rescue for Multiple Projects

21:22
Sun
09
Apr 2017

EditorConfig to the Rescue for Multiple Projects

I was once asked to participate in a project where coding standard required to use indentation of 3 spaces - different than what I do normally, when I use 4 spaces. I was searching Internet for answer whether Visual Studio supports per-project settings for this and I've found out that it doesn't, but came across this instead: EditorConfig.

This technology is so simple you can learn all about it in just few minutes, still very useful for cases like mine. You can basically create text file called .editorconfig in root directory of your project and describe configuration for editors using a simple language. For example:

root = true
[**]
charset = utf-8
indent_style = space
indent_size = 3

Of course your text editor must support that. It turns out many of them support this standard natively. Editors I care about have plugins for that available. Unfortunately the one for jEdit doesn't seem to work (I've reported this issue), but the one for Visual Studio works perfectly. Now I could have per-project configuration for text editor, including character set, line ending type, and indentation type (tabs versus spaces and the number of spaces).

Comments (1) | Tags: ide | Author: Adam Sawicki | Share

Comments

Fiołek
2017-04-10 00:18:08
Yeah, EditorConfig is great for public/shared projects. What is more, VS15 supports this natively (!) and extends its basic capabilities (at least for C# - https://blogs.msdn.microsoft.com/dotnet/2016/12/15/code-style-configuration-in-the-vs2017-rc-update/).

Post comment

Nick *
Your name or nickname
E-mail
Your contact information (optional, will not be shown)
Text *
Content of your comment
Calculate *
(* - required field)
STAT NO AD [Stat] [Admin] [STAT NO AD] [pub] [Mirror] Copyright © 2004-2017 Adam Sawicki
Copyright © 2004-2017 Adam Sawicki