Monday, January 29, 2007

VS 2005 IDE Tip - Solution Specific Code Formatting/Settings Macro

vs.Eco - Another Visual Studio IDE Tip

"...

Many of us work on multiple projects at the same time, and some of those have different coding conventions. For example, you might be involved in a work-related project that uses company-defined conventions, but also participate on open source projects with their own coding styles. However, currently visual studio settings for Code Formatting are global and cannot be easily overridden.

Here’s what Paul came up with:

For each solution, create a .vssettings file containing the editor options you want to modify and add it to the solution. Then create a macro hooked up to the “Solution Opened” event to import the .vssettings file automatically.

The macro is really simple (add it to the EnvironmentEvents module): ..."

Very nice. This technique provides for Solution specific .vssettings files. Simple and yet pretty darn cool idea.

See the original post for the macro code (I didn't want to be a TOTAL leach... this time... ;)

No comments: