views:

74

answers:

2

I have a project with many projects that performs miserably with ReSharper enabled, even on a pretty decent machine (8GB RAM, hybrid solid state hard drive, Core 2 Duo processor).

I was able to find out how to suspend ReSharper, but none of the default key bindings for Visual Studio (e.g. Ctrl-[comma] to navigate to type) seem to be working when I turn ReSharper off.

How do I get back the default key bindings when I disable ReSharper (and get the ReSharper bindings back when I enable ReSharper)?

+1  A: 

Tools menu -> Import and Export Settings... contains the functions you need. You can create separate settings files (.vssettings) for parts of your VS configuration, and then restore them later.

If you want to quickly switch between configurations, ensure that Visual Studio is not running, then go to the user's documents directory, then into the corresponding Visual Studio version directory, then into the Settings directory underneath that. The CurrentSettings.vssettings file is what is loaded by Visual Studio. Substitute that file with another .vssettings file containing the settings you want, and you're good to go.

These .vssettings files are regular XML files, so you could devise a clever little program to rewrite the portions of the files you want to change.

Warren
Do you know how to create a single command at the command line to import and export the settings? (Figured I might as well milk this bounty for all it's worth...)
Josh Kodroff
I've updated the answer.... hope this helps!
Warren
+2  A: 

Prior to resetting the keybindings in VS, export a backup copy of your current ReSharper settings:

Tools -> Options -> Environment -> Import and Export Settings -> rename file to ReSharper.vssettings -> click OK

Then repeat the previous steps but rename it back to CurrentSettings.vssettings.

Next reset the VS keybindings by:

Tools -> Options -> Environment -> Keyboard -> click the Reset button.

That should restore the settings back to the original VS default keyboard bindings and remove all of ReSharper's. (Note this also will remove any custom keybindings that you might have defined unrelated to ReSharper.)

As stated in Warren's answer you could use two VS settings files one of ReSharper and one for (non-ReSharper) default VS and import and load the one as needed.

This could be automated by creating some VS macros:

Public Sub ExportVsSettings()

    DTE.ExecuteCommand("Tools.ImportandExportSettings", "-export:c:\MyVSSettings\CurrentSettings.vssettings")

End Sub

Public Sub ImportDefaultVsSettings()

    DTE.ExecuteCommand("Tools.ImportandExportSettings", "-import:c:\MyVSSettings\Default.vssettings")

End Sub

Public Sub ImportResharperVsSettings()

    DTE.ExecuteCommand("Tools.ImportandExportSettings", "-import:c:\MyVSSettings\ReSharper.vssettings")

End Sub

You can then assign keyboard shortcuts to these macros for ease of use.

Ray Vega
gotta give a +1 for the macro idea.
Warren