un-resolve a resharper conflict with Visual Studio - visual-studio

I am using VS 2012 with Resharper 7. I had resolved a conflict for a VS command and now I want to undo it.
That is, I want to use the Resharper command for that particular command. I am not asking about changing the whole scheme.
This link only informs on how to resolve a new conflict. What about a conflict that I had resolved earlier and now I want to change it?

You have to just re-assign it manually the way you would set up any other keyboard shortcut. Go to Tools -> Options -> Environment -> Keyboard to set up the shortcuts. All Resharper commands start with "Resharper", so type that in the box under "Show commands containing:". At that point you just need to find the command you want and set the keyboard command for use in "Text Editor".

You can reapply the ReSharper keyboard shortcut bindings in the options dialog (Environment → Keyboard & Menus) and hitting "Apply shortcuts".

Related

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.

ReSharper key bindings problem

I use: Visual Studio 2010 Ultimate, Resharer 6.
In ReSharper's options i choose Visual Studio keyboard sheme and click Apply Sheme:
After that some shortcuts are not assigned, such as: Go to Declaration, Go to implementation, Find Usages, Complete symbol, etc:
Try
Tools -> Options, Environment -> Keyboard -> Reset
Import and Export Settings, re-import C# developer settings
devenv /reset
Nothing helped.
Configure shortcuts manually is not desirable.
Help, please.
This one worked for me 100% after trying a bunch of other things:
Go to Tools -> Options -> Environment -> Keyboard -> Press the (RESET) button
Go to ReSharper - > Options -> Keyboard & Menus -> Select the "Visual Studio" scheme -> Press "Apply Scheme"
Press "Save"
Press "CTRL-T". Since this shortcut is mapped in both VS and Resharper, you will be presented with the "Shortcut Conflict"-window. Here you select "Use ReSharper (Ultimate) command" and make sure to check the box "Apply to all ReSharper (Ultimate) shortscuts".
Voila!
This is a known issue that affects all ReSharper shortcuts that include F12 after switching from IntelliJ keymap to VS keymap. It's documented in this bug report that you're free to watch and vote for.
As far as I'm aware, the only workaround would be to reassign the broken shortcuts manually through Tools > Options > Keyboard.
Hpersw's solution works. in VS -> Tools -> Import & Export Settings -> Reset all settings and press finish. This should give you the shortcuts back
After wrestling with this for half a day and trying all of the options above, I finally found the magic setting that fixed MY problems: I UNSELECTED "Hide overriden Visual Studio Items" in Options/Keyboard and Menus"
In VS go to Tools -> Options -> Environment -> Keyboard -> Apply the following keyboard mapping schema: [Default]
The easiest way to solve this problem is :
Go to: ReSharper -> Manage Options -> Reset All Settings
These steps gonna solve your shortcuts (key bindings) issues.
You do not have to keep performing the following actions:
1) Go to Tools -> Options -> Environment -> Keyboard -> Press the (RESET) button
2) Go to ReSharper - > Options -> Keyboard & Menus -> Select the "Visual Studio" scheme -> Press "Apply Scheme"
I know this is a little old, but I just thought I'd share my epiphany... It seems that with Resharper 7x and VS2010 (probably anything later too), is best set when you op for the selecting the "Text Editor" as the settings to update under Options->KeyBoard. So, what I would recommend if you like some of Resharper features, use this site to get the shortcuts Resharper Shortcuts
Then set them accordingly with Text Editor selected as the settings to update. Global does NOT seem to work consistently.
FYI- Text Editor works for C#, CSS and javascript. Not sure about other languages within VS.
Taken from the documentation on Configuring Keyboard Shortcuts:
To switch between two available keyboard schemes or restore the default state of your currently selected scheme
On the main menu, choose ReSharper | Options.
Select Environment | Visual Studio Integration.
In the Visual Studio Integration tab, select Visual Studio, ReSharper 2.x or IntelliJ IDEA, or None, and click Apply Scheme. If you selected None, you can define an arbitrary set of custom keyboard shortcuts in Visual Studio's native Options menu (Tools | Options | Environment | Keyboard) - see To configure keyboard shortcuts above.
Also, here's some documentation on how to resolve keyboard shortcut conflicts with Resharper
Doing "Reset All Settings" in VS Import&Export usually helps with restoring shortcuts. But it will, eh, reset all VS settings.

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".

Resharper 5 shortcuts & keyboard schemes

I am used to Finding Usages by hitting Shift-F12, but after switch to R# 5 on vs 2010 that one isn't obviously available.
I've got the keyboard scheme set to Visual Studio, as opposed to the only other choice which is R# v2/IntelliJ (the shortcut for usages in that scheme is Alt-F7).
Can anyone help me get back to Shift F12 through a R# setting?
Cheers,
Berryl
EDIT
I can use VS to set any keyboard command I want , of course. BUT in light of other buggy R# 5.0 behavior I am wondering why the old shortcut isn't there anymore.
Can't you update the VS keyboard mapping?
In VS
Tools -> Options -> Keyboard -> Search for command "ReSharper.FindUsages"

Resources