Is it possible to search for keyboard shortcuts by a keybind (Visual Studio 2017) - visual-studio

I want to find all shortcuts that are using a specific keybinding in an easy and reliable way.
In Visual Studio the only reliable way I've found so far is by changing a shortcut's keybinding and get list of shortcuts using the same keybinding. I think it's too roundabout and I'm looking for a way similar to VS Code.
In VS Code in the Keyboard Shortcuts tab you can search by a keybinding (by writing "Ctrl + R" for example) and you will get all shortcuts using that keybinding.
Is there a similar way to do this in Visual Studio?

If you open Visual Studio keyboard options and Press shortcut keys in the corresponding box, in the Shortcut currently used by list you will see all commands for this shortcut:

Related

Multiple keybinds to same command in Visual Studio (i.e. not vscode)

I am specifically using Visual Studio 2022 and would like to have two separate keyboard bindings to open the terminal (View.Terminal).
I found the answer whilst writing this, just adding new keyboard shortcuts doesn't seem to remove the previous one(s) but this wasn't obvious throught the GUI. To change keyboard shortcuts one goes to Tools>Options>Environment>Keyboard where one can see and set keyboard shortcuts. In my case it wasn't obvious because I had one keyboard shortcut per keyboard layout and the GUI only shows the keyboard shortcuts for one keyboard layout at a time.

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: Shortcut Info

for some/most of the functions in Visual Studio there do exist shortcuts. Sadly it's hard to find them.
I'm looking for a addin/tool that will display me information for a shortcut.
For example:
I comment a line with // and the tools gives me information that the shortcut for this is STRG + K, C.
I press some button, let's say debug and it shows me that the shortcut would be F5
For offline use there's the posters with key bindings, but inside VS I'd recommend the IntelliCommand extension which will show you key combinations when you press ctrl (+ some other key).
No other addin/tool required. In Visual Studio, under Tools > Options > Environment > Keyboard, you can find all available shortcuts.

Visual Studio Productivity Power Tools - Solution Navigator Shortcut

Love the Solution Navigator in VS2010 power tools. But can't find a shortcut combination that opens it?
Looking in my keyboard mappings it was down as Ctrl w+ Ctrl F. This seemed to clash with the search functionality so I reassigned it.

Visual Studio shortcut for "quick fix"

Does Visual Studio 2010 have a shortcut for quick fix?
I'm tired of grabbing the mouse, hovering over this red line, waiting for the little clipboard icon to appear, clicking on the first menu item. It would be so much fast to just open that dialog with some keys and confirming the first (i.e. selected) item.
The feature is called the "Smart Tag".
Default Keyboard Shortcut Schemes (ReSharper documentation)
Stack Overflow question How does one set Visual Studio 2010 keyboard shortcuts comfortably, especially when using ReSharper?
Stack Overflow question Visual Studio keyboard shortcut to automatically add the needed 'using' statement
They can usually be invoked via the keyboard using either:
Ctrl+. (on a standard QWERTY keyboard)
Alt+Shift+F10 (if you've not got Function Lock enabled)
If your cursor is on the item that is underlined, you can use Ctrl + . to pop up the intellisence/suggestion context menu.
Alt + Shift + F10 does the trick.
Via #Rohit from Visual Studio keyboard shortcut to automatically add the needed using statement
If you want to edit the shortcut of quick fix you can do the following:
Open Tools->Options->Keyboard and in the Show commands containing field enter EditorContextMenus.CodeWindow.QuickActionsForPosition and replace the old shortcut with the new one.

Resources