Disable menu bar shortcuts in Visual Studio 2010 - visual-studio-2010

I'm using the Emacs plugin for Visual Studio 2010, and I'd like to liberate my meta key.
When I press Alt-foo, I activate drop-downs on the menu bar instead of lovely Emacs commands. For example, I open the analyze menu when I try to move forward by one word, since both commands are invoked with Alt-N.
How do I disable the menu bar Alt- shortcuts and fully appreciate my Emacs environment?

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.

How do you switch focus directly to docked windows in visual studio?

As a vim user, I am used to being able to switch the focus to different windows that are side by side with Ctrl-W [hjkl]. While Visual Studio offers very nice organization using docked windows, I find that using the Ctrl-Tab navigation window disorienting when all I want to do is switch focus to the pane that is to the left or right of the one I'm currently using.
Is there any good way to switch focus in Visual Studio between open windows?
I am using Visual Studio 2012.
As a (Vs)Vim-mer I am also looking for that essential feature.
Yesterday my VS2013 was behaving strange, but today it is working fine again (don't know what happened), i.e.:
When you have enabled VsVim Handling for ctrl+w in
Tools/Options/VsVim/Keyboard
then Visual Studio behaves like gVim.
If it happens that Visual Studio does not behave as expected (like yesterday ;-)) then you may alternatively use the similar shortcut:
ctrl+F6 which is assigned to Window.NextDocumentWindow.
This is quite sufficient to switch between both panes. If you hold the ctrl key down and typing F6 another time then it switches to another window, so release the ctrl key when having switched the pane.
You may add / change to another shortcut for this command via the Environment/Keyboard Option.

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.

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