views:

174

answers:

3

The Visual Studio options dialog allows you to set tab preferences (size, insert-spaces, etc.) on a per-language basis. But I am regularly working on a couple of c# projects with different settings for these values.

Is there a way to override the global settings on a per-project basis, or at least toggle between them easily?

A: 

I'm afraid you can't do that on a per-project basis. But, with Tools/Import and Export Settings... you can export each settings in a file and you could import the one that fits your current project.

cedrou
+3  A: 

Another approach may be through the extensibility API: it should be possible to write a macro or add-in that changes these settings.

E.g. to change the tab size to 6, use the following:

    DTE.Properties("TextEditor", "CSharp").Item("TabSize").Value = 6

Here's a link that explains how to find out the names of the properties: http://support.microsoft.com/kb/555445

jeroenh
+1 I think this is the most frictionless option for me.
Gabe Moothart
+1  A: 

You can open visual studio with a special "reset" settings file which overrides the default settings. Using this method it is possible to create two shortcuts, one with each tab setting. Details are here.

Gabe Moothart