How to Restore Navigate To Dialog in Visual Studio After Resharper Installation - visual-studio-2010

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.

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.

It should be noted that the command for ReSharper's navigate to dialogue is "Ctrl + T"

In Visual Studio 2017, you need to assign Ctrl+, to Edit.GoToAll (rather than Edit.NavigateTo).
UPDATED:
Go to the Options->Environment->Keyboard, Make sure that (Default) is chosen in the top dropdown, type in Edit.GoToAll in the "Show comands..." textbox. Remove the existing shortcut. Type Ctrl+, in the "Press Shortcut Keys:" textbox. Click assign.

#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+,

Related

In Visual Studio, what is the keyboard shortcut and Command ID to "search/query everything box"

In Visual Studio 2021 or above what is the keyboard shortcut (KeyMap) Command ID to the "search everything box"? This box is displayed top right of IDE menu bar. It offers a global search including, IDE actions, menus, commands and symbols within code.
The default Ctrl+Q is NOT assigned on my config, used for something else.
Please see the screenshot:
Could not find the correct command in KeyMap. For information, in JetBrains Rider, this command is called "Search Everywhere".
On my installation of VS 2022 the placeholder text within the search box is "Search (Ctrl+Q)".
Pressing this shortcut in the keyboard mappings yields the Shortcut Window.QuickLaunch
The page you linked to also shows this is the default settings for Window.QuickLaunch.
According to Visual Studio documentation
Use the Ctrl+Q keyboard shortcut to access the search box
Advance Shortcuts:
The search results include tabs for All, Code, Visual Studio. You can save time by using the following keyboard shortcuts for different types of searches:
Ctrl+Q, Ctrl+T for files, types, and members
Ctrl+Q, Ctrl+M for Visual Studio menus, options, components, and templates
Ctrl+Q, Ctrl+E to go to the All tab, for both
Please try with Ctrl+Q it is working fine in visual studio 2022.

Visual Studio: Shortcut to close window not working

I changed the shortcut to close a window to Ctrl+W and to close all windows to Ctrl+Shift+W. Close all windows works fine, but Ctrl+W selects the word currently under the cursor but does not close the window.
When I right-click a tab it say Ctrl+W is the shortcut to close it (And also Ctrl+S to save and Ctrl+Shift+W to close all). Why is only the close window shortcut not working?
In Visual Studio (VS 2015 in my case but it's similar down to VS 2010 at least) keyboard shortcuts may have a different meaning depending on the context in which they are executed.
Click Tools / Options / Environment / Keyboard to look up or define shortcuts (you already did that probably). What I called "context" is selected in the combobox labelled "Use new shortcut in:". Most likely you defined the shortcut in "Global" but you want it to work in "Text Editor". In the latter Ctrl+W selects the current word.
Redefine Ctrl+W for "Text Editor" and you should be fine.
I am using Visual Studio 2017 & Visual Studio 2019 and tried the answer from #TobiMcNamobi but it didn't work for me. After few such tries I got it work with below steps.
You should add it as Global shourtcut otherwise it will not work for Designer views.
Add CTRL+W as a Global shortcut for Window.CloseDocumentWindow
Remove the CTRL+W shortcut for Edit.SelectCurrentWord
In Visual Studio 2019 it is Ctrl-F4 by default to CloseDocumentWindow. The action is Window.CloseDocumentWindow. I know this is old but the accepted answer has you change the short-cut key instead. I would rather use the default option.
Tools -> Options -> Environment -> Keyboard
If you're ever unsure go to the path above and you will see the image above then you can click inside the box "Press shortcut key" at the bottom of the form and type the short cut key you're interested in and it will tell you if it is used and what it is currently used for.
You can also reference the docs
https://learn.microsoft.com/en-us/visualstudio/ide/default-keyboard-shortcuts-in-visual-studio?view=vs-2019
2021: For Visual Studio 2019:
See: https://gist.github.com/jpoehls/2030795#gistcomment-2335647
In my case, I had to existing assignments that I had to remove. Thereafter, I could use the hotkey.
In my case, the tabs were not closing because I am using Vim extension. I had to add the following lines to Vim settings:
"vim.handleKeys": {
"<C-w>": false
}
Just press Ctrl + , or Command + , for Mac users, search for Vim and go into Edit in settings.json as the following picture shows:
Screenshot
For Visual Studio 2022, make sure you also remove Ctrl+W from selectCurrentWord command.
In my VS Pro 2019, on Tools / Options / Environment / Keyboard, the first line offers using a premade keyboard mapping scheme, with a drop-down option for VSCode keyborad mapping theme.
I picked it and it seems to have adopted the keyboard shortcuts I was used to from working on VSCode, Ctrl+W included.
For those using linux with VSCode v1.56.2,
File --> Preferences --> Keyboard Shortcuts.
Search for View:Close Editor and as mentioned above, remove any keybinding that has the keybinding you want.

Visual Studio 2010 "Open With..." is missing?

I'm trying to change Visual Studio to open my code instead of designer by default. This question tells me to right click on a file and go to "Open With..."
However, when I try to right click on a file in my solution explorer I have no "Open With..." option. I'm not sure if this is caused by an extension (I have the CodeRush Xpress, VSCommands, Productivity Power tools, and VCS tools for SVN, Git, and Hg), or what, but I would like to be able to configure what my files open with.
Where do I need to go to either get the menu option back or change these settings?
The context menu can be modified. If you haven't heavily customized your command bars and menus then a full reset is wise. Tools + Import/Export, "Reset all settings" radio button.
Or fix the context menu. Tools + Customize, Commands tab, click the "Context menu" radio button. Select the "Project and Solution Context Menu | Item" option from the combobox. Click the Add Command button.
This MSDN link might help you:
How to: Change or Add a Default Editor
It's not the most intuitive method, but from the link:
On the File menu in Visual Studio, choose Open and then select File.
In the Open File dialog box, select a file of the type you want to change.
Still in the Open File dialog box, click the down arrow next to the Open button, and then select Open With.
In the Open With dialog box, choose an editor from the Select a program to open list.
Click the Set as Default button and then click the Open button to open the file.

How to add Close All But Pinned command to Visual Studio 2010 menu or toolbar?

I've implemented the suggestions in Scott Hanselman's blog post Simplify your Visual Studio 2010 Toolbar and Free Your Mind. Very cool.
Where can I find/execute the command "Close All But Pinned" that is part of Visual Studio Productivity Power Tools.
You can assign a shortcut in Tools -> Options -> Environment -> Keyboard. Search for Window.CloseAllButPinned in the Show commands containing: textbox and assign your own key combination.
Similarly, you can execute that command in the "Go To Find Combo" small box, i.e. press Ctrl+/ then type ">Window.CloseAllButPinned", press Enter.
It is a two step process:
Create a Macro with the following
Public Module myToolbar
Sub CloseAllButPinned()
DTE.ExecuteCommand("Window.CloseAllButPinned")
End Sub
End Module
Right click on your Toolbar, choose Customize, Add Command, Category Macro, choose MyMacros.myToolbar,CloseAllButPinned
Then click ModifySelection and give it an easy to remember name

Is there a Visual Studio keyboard shortcut to rename a file in Solution Explorer?

As the question title says: Is there a Visual Studio keyboard shortcut (or series of shortcuts) to rename file in Solution Explorer?
I am using VS2008 and manually doing this by right-clicking on a file in the Solution Explorer and selecting 'Rename', but this is a pain in the behind.
Depends on your settings profile:
In the C# profile, F2 does this.
you can assign a shortcut to any key:
Tools -> Options, Expand Environment and select Keyboard
Enter File.Rename into the text box
Put the Focus on the "Press Shortcut keys" box and hit 'the key you want to assign'
Click Assign
No use option Refractor.Rename and Assign key to that say F2
Use: File Utils Extension
command T or control T >File Utils: Rename, that's it.

Resources