How do I suspend ReSharper 5.0 AND get back the default key settings in Visual Studio 2010?

StackOverflow https://stackoverflow.com/questions/3142466

  •  01-10-2019
  •  | 
  •  

문제

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)?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top