After installing Resharper 7.1.2 for Visual Studio 2010, when I press Ctrl+, I no longer see the Navigate To
dialog. Instead a Resharper dialog Recent Files
appears. My question is, is there another key binding that I am not aware for the Navigate To
dialog or how can I configure Resharper/VS to show the Navigate To
dialog upon pressing Ctrl+,. In the Resharper options I have selected Visual Studio
for the key bindings since that is what I am accustomed to, but for some reason this one has changed.
问题:
回答1:
It sounds like you will need to remove the ReSharper keybinding and add the Visual Studio one again. Try the following:
From Visual Studio 2010, go to Tools -> Options -> Environment -> Keyboard.
In the textbox below "Show commands containing:" enter "gotorecent".
This should bring up one match and you can see the Ctrl+, shortcut applied:
Click the Remove
button. This should remove the keybinding.
In the textbox below "Show commands containing:" enter "edit.navigateto" (or for VS2017 "edit.gotoall").
This should bring up two matches. We are only concerned with the first one so make sure it is selected.
Click the texbox below "Press shortcut keys:" and press Ctrl+,
Click the Assign
button.
Click the OK
button.
You may have to restart Visual Studio but that should do it.
Edit: Just in case it helps anyone else, in order to track down the command names, I exported the keyboard settings via Tools -> Import/Export settings -> Export selected environment settings -> select only Options -> Environment -> Keyboard. In the resulting .vssettings file, the Command attribute of each Shortcut element contains the text that should be typed into the "Show commands containing:" textbox.
回答2:
It should be noted that the command for ReSharper's navigate to dialogue is "Ctrl + T"
回答3:
In Visual Studio 2017, you need to assign Ctrl+, to Edit.GoToAll (rather than Edit.NavigateTo).
回答4:
@Malice explained really well, but here is just one more tip: When you are in the Keyboard Options menu, you don't need to export all commands in order to see which command corresponds to a particular shortcut, you can click on the "Press shortcut keys" text box and type your keyword to see what it is assigned to.
So you could:
- go to the Keyboard Options menu,
- type Ctrl+, to see what it is assigned to,
- unassign it,
- then type Ctrl+T to see what that "Navigate To" dialog is called within VS
- reassign that function to Ctrl+,