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

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.

Related

CTRL+D doesn't work in Visual Studio 2022

CTRL+D (duplicates) It doesn't work in visual studio 2022 , How to change Ctrl+E,V To CTRL+D ?
I just had the same problem.
The issue for me was that Visual Studio 2022 had set the mapping scheme to Visual C# 2005 instead of (Default).
In the search bar at the top of Visual Studio 2022 (Ctrl+Q), search for key bindings, or go to Options->Environment->Keyboard.
Make sure the keyboard mapping scheme is (Default).
I hope it helps.
Duplicate line is implemented via Ctrl+E,V as explained here.
This operation does leave the clipboard untouched.
Command and respective keys are shown in the Edit Menu.
Go to TOOLS -> Options -> Environment -> Keyboard and then on 'Show commands containing:' search Edit.Duplicate and on 'Press shortcut keys:' press Ctrl+D and click on 'Assign' button.

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.

How to enable C-U/C-D with ReSharper installed

I have recently installed VsVim and ReSharper into VS 2010. The ReSharper hotkeys seem to override those of VsVim.
Is there a way to make VsVim commands higher priority than those of ReSharper?
More specifically, I would like Ctrl+U and Ctrl+D to work like in Vim.
When I press Ctrl+D the shortcut conflict window appears and there doesn't seem to be a PgDown option.
On the window in the image select Visual Studio. Then open a text file (.cs, .cshtml, whatever) and in the bottom right of the window is an "options" button to the far right of the vsVim cmd line you type into. Click the options button and you will get a list. It will say "Ctrl_D handle with" and your options will be Visual Studio or vsVim; just switch it. You can come back and undo it later. I have VS2010, Resharper and vsVim and don't have the issue, but it may also be a .vimrc config setting where you need to disable the msvim options.
You need to tell ReSharper that you want Visual Studio to handle those keyboard shortcuts instead of ReSharper (in the window you show in your question), and tell VsVim that you want it to handle them instead of Visual Studio.
In up-to-date versions of VsVim, you do this by going to Tools -> Options -> VsVim -> Keyboard (by "Tools" I mean the menu in the Visual Studio menu bar). There you can configure what you want VsVim to handle. There used to be an "Options" button at the end of Vim's status bar, as John's answer says, but that is no longer true.
I have CTRL-d and CTRL-u set up to scroll in my VsVim configuration so I can vouch for it working.

How does one set Visual Studio 2010 keyboard shortcuts comfortably, especially when using ReSharper?

In every Visual Studio.NET version you can set keyboard shortcuts using menu Tools -> Options -> Environment -> Keyboard and then find the command you want to assign a shortcut to by entering part of it in "Show commands containing".
For one thing, the listbox is ridiculously short and hard to navigate - is there an alternative?
Then, how do I find out the correct command name for a specific action?
Specifically, I'm using ReSharper 5.1 with Visual Studio 2010 and want to have the Alt + Enter shortcut back (it used to be there in older versions by default) that opens the ReSharper context menu when the cursor is over a curly underline ReSharper uses to highlight errors or warnings.
How do I find out the command name for that (except by an educated guess)?
The way I do this is to perform an action while recording a macro (using Tools / Macro / Record temporary macro).
When I have finished with the action, I look at the source code of the macro and it usually helps to find the correct command.
For example, I have just let R# add some magic through Alt-Enter, and the macro recorder has:
DTE.ExecuteCommand("ReSharper_QuickFix")
You can rebind all of the ReSharper shortcuts by using the ReSharper -> Options -> Visual Studio Integration page. Select a keyboard scheme and hit "Apply Scheme".

How to open header file (.h) in visual studio 2005

I'm tired of right clicking on the header file in c++ and choosing open document "blahblah.h"
Is there a keyboard shortcut?
I don't have VS 2005 installed anymore, so I can't guarantee it, but in 2008 you don't need a macro or VA-X for this (though you certainly want Visual Assist X if you don't have it). I don't recall much change in this for quite a while, so I'd expect it to work in VS 2005 as well.
Select Customize... from the Tools menu. Click on the Keyboard button at the bottom left corner of the dialog that comes up. In the "Show Commands Containing" field, type in "header". One of the commands that shows up should be something like "EditorContextMenus.CodeWindow.GotoHeaderFile". Select that. In the Press Shortcut Keys field, press the keys you want to use to open the header file.
You need to use Visual Assist or write a macro.
http://www.alteridem.net/2008/02/26/visual-studio-macro-to-switch-between-cpp-and-h-files/

Resources