How to enable C-U/C-D with ReSharper installed - visual-studio-2010

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.

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.

How to remove all resharper keybindings?

I like resharper fine, but with the new pricing, the trial ran out and I want to try life without it.
Except after disabling all the Resharper commands are still bound in my keyboard options! So ctrl+, doesn't fall back to the standard VS behavior because its bound to Resharper.Resharper_GotoRecentEdits which is, of course, disabled.
Even clicking Reset in the keyboard options does not remove the keybindings.
So what the heck. How do I get rid of all the resharper stuff? It is currently suspended and doesn't have a menu item.
This is Visual Studio 2015 with Resharper Ultimate trial
The following steps worked for me:
Disable ReSharper
In ReSharper's options -> Keyboard & Menus, select the Visual Studio scheme and click on Apply Scheme.
Mind the note under the Apply Scheme button: Click save to close the ReSharper Dialog and...
In TOOLS --> Options | Keyboard, make sure the right mapping scheme is selected (Visual C# 2005 for me) and click Reset and finally, Ok
That did the trick for me. opening the keyboard dialog once again and hitting Ctrl+, in the Press shortcut keys was no longer showing the key mapping to be bound to Resharper.Resharper_GotoRecentEdits
As per my comment on the initial post - it seems sometimes you have to uninstall ReSharper to remove the key bindings.

Remove Shortcut Added by NCrunch from VS

I use the Visual Studio VsVim extension, I've recently installed NCrunch which seems to have grabbed the CTRL+R shortcut.
How can I 'return' this shortcut to VsVim?
Try the following
Click on the Options button. It is on the bottom right of the editor screen
Look for Ctrl+R. Switch control to VsVim
If Ctrl+R doesn't appear in that menu please let me know and I'll provide an alternate method

Resharper 8 - Quickfix shortcut Alt+Enter gone

In Visual Studio 2012/2013, I want to reassign the Alt+Enter ↵ key combination to the "Quickfix" (triggering the menu from the light bulb) because it is not working anymore. I can't. I have tried the following (I am aware that some of the suggestions refer to VS 2010 and older R# versions):
Tried to change manually in Tools - Options - Keyboard: the former ReSharper_QuickFix entry is gone, see ReSharper_QuickFix gone
Tried Resharper_AltEnter as suggested in What is the name of the ReSharper's Quick Fix command - nothing, no shortcut
Switched back and forth settings in ReSharper -> Options -> Keyboard & Menus as described in Resharper Alt Enter not working - nothing
Switched back and forth settings in ReSharper -> Options -> IntelliSense -> General as also described in Resharper Alt Enter not working to no avail
Tried other suggestions from the same page
Sledgehammer approach: run devenv.exe /ResetSettings - nope
Search SO and the web up and down - found nothing
I have not yet had the nerve to re-install R# or even VS.
How can I get a standard set of R# keyboard shortcuts into Visual Studio? I'd gladly wipe out everything that is there just to get back my Alt+Enter Quickfix..
Please try this:
remove all mapping for Alt+Enter ↵ shortcut here Tools | Options | Environment | Keyboard (to find out mapped actions, press Alt+Enter ↵ in "Press shortcut keys" field and look at the list in "Shortcut currently used by" dropdown);
After removing:
Type ReSharper_AltEnter in "Show command containing" field;
Select "Text Editor" in "Use new shortcut in" dropdown;
Press Alt+Enter in "Press shortcut keys" field | Assign;
Select "XAML UI Designer" in "Use new shortcut in" dropdown;
Press Alt+Enter in "Press shortcut keys" field | Assign;
They changed the name of this shortcut to Resharper_AltEnter.
I had the same problem. I'd upgraded to VS Professional 2013 (update 3) about a week ago. I then installed Resharper and was re-tooling a few projects with Resharper for a few days. All was going well, then things went haywire. I tried all the suggestions in this post and elsewhere. This included un-installing and re-installing resharper. Un-installing and re-installing VS. Nothing seemed to be fixing it
Until at some point I tried what turned out to be the fix: uninstalling a couple of the R# extensions: Resharper.ExternalAnnotations, Nuget Support for Resharper and Resharper Razor Plugin.
Not sure which was causing the issue. But things seem to be working normally now.
I also went further and installed the latest ReSharper 8.2.3 - https://www.jetbrains.com/resharper/download/
Things are still ok [crossing fingers].
I have NOT installed any R# extensions. I will try to figure out which was the offending extension after I have had a few days of rest for this issue. So, in retrospect, it seems this problem started after I installed some offending R# extension.
https://www.jetbrains.com/help/resharper/Code_Analysis__Quick-Fixes.html
Merge Visual Studio Light Bulb actions into ReSharper bulb - set checkbox in R# settings

Resources