Switch Visual Studio Settings for Different Solutions

2014, Nov 10    

Switching between projects with different formatting styles can be a real pain. I have finally found a solution if you are using Visual Studio and a partial solution for most other platforms.

If you add two configuration files to the root of the solution, they will automatically configure your editor to the coding standards of the solution when you open it and restore your settings to your defaults when you close.

Editor Config

This file defines spacing and tabs for the files in the solution. There are plugins available for pretty much every editor and IDE out there including Visual Studio, Vi, Emacs and even Notepad++.

For more information, got to http://editorconfig.org/. The Visual Studio extension is on GitHub, and can be installed from the Visual Studio Gallery.

Rebracer

Rebracer sets all of the code formatting rules for the project when you open the solution and restores your defaults when you close. To change the settings you simply need to open edit the Visual Studio options and the changes will automatically be saved out to the Rebracer.xml file.

Rebracer is also on GitHub, and can be installed from the Visual Studio Gallery.