Create Visual Studio Keyboard Shortcut that include Mouse Click - visual-studio

Is it possible to create a short cut in Visual Studio that includes a left mouse click?
Currently, Ctrl + Left Click short cuts to Go to Declaration.
I'd like to map Ctrl + Shift + Left Click to Go to Implementation.
I know I can create a keyboard only shortcut, but I'd like to include the mouse.

From what I know this is not supported by default in Visual Studio.
You can have Ctrl + Alt + Left Click to go to implementation with ReSharper.
Using ReSharper you have an option for this in ReSharper options:
ReSharper is a paid extension that brings a lot of great features to Visual Studio. I'm not affiliated in any way with ReShaper. I'm just a fan of the extension.

Related

Reactivate Multi Caret Shortcut after Resharper in Visual Studio

The usual multi caret short cut since VS2019 is
Ctrl + Alt + click : Add a secondary caret
as described in this answer.
After the installation of resharper it overrides this shortcut unfortunately with a navigation feature.
I looked throughout the shortcuts in environment-keyboard options in VS but apparently you cannot change or reinstate this shortcut according to this post.
How do I get my beloved multi-caret functionality back into my hands?
I found it! The Solution is to take away the key combination from Resharper.
Go to Resharper Options => Environment => Search & Navigation
and uncheck the Ctrl + Alt + Click checkbox:
and Visual Studio will allow you again to use the multi-caret functionality!
Here is the original link on how to disable the navigation functionality in resharper.

Visual studio 'Ctrl + Alt + Click' goes to implementation

I used resharper and there has been a very useful thing .
'Ctrl + click' - goes to definition
'Ctrl + Alt + click' - goes to implementation
If there are more than one implementation the list of all implementations shows up and you can choose a necessary implementation
Is there a way to make it in the visual studio 2019.
PS: I know about visual studio Ctrl + F12 .But I'm interested particularly in ctrl + alt + click
If you are using ReSharper, then you can enable this in the Options -> Search And Navigation but I don't think VS offers this out of the box.
And if you are using JetBrains Rider, then you can go to File -> Settings, search for implementation and right click on Implementation(s) and select Add Mouse Shortcut and then do Ctrl Alt Click

Visual Studio Keyboard Shortcut of quick watch (shift + F9) Not Working

My quick watch (shift + F9) shortcut suddenly is not working.
But its alternate keyboard chord Control + Alt + Q works fine.
And all other shortcut seems working fine. But quick watch is the only one that I currently found.
I have tried other shortcut with Shift or with F9 , no problem.
I am also using Resharper, is that affecting VS Shift F9?
If you have Snag-It installed on your machine, its global shortcuts may override application specific shortcuts in Visual Studio (or other apps).
See #nuri's answer here: Visual Studio 2010 QuickWatch window not visible for instructions and screen-shots to change the Snag-It settings.
In the meantime, just go into the Snag-It preferences, the HotKeys tab, and set the "Video capture start/pause/resume" hot key to something other than [Shift]-[F9]. For myself, I only use "Global capture", so I set everything else to "None".
You can try the following:
In TOOLS --> Options | Keyboard, make sure the right mapping scheme is selected (Visual C# 2005 for me) and click Reset and finally, Ok

Can you turn off Peek Definition in Visual Studio 2013 and up?

In Visual Studio 2013 and up, there is the Peek Definition feature when you Ctrl + Click. At first I thought this was cool, but I have found that the majority of the time, I need to click the Promote to Document button, since I make lots of changes to the files I Ctrl + Click on. But after Googling how to turn off Peek Definition, I can't find any details on if this is possible. What I would really like is for the Ctrl + Click functionality to go back to opening the definition in its own tab, like in previous versions of VS. Is this possible?
In pre 2017 Visual Studio:
Tools→Options→Productivity Power Tools→Other Extensions→Control click shows definitions in Peek
Adam Garner pointed out that in Visual Studio 2017, the location is:
Tools→Options→Text Editor→General→Enable mouse click to perform Go to Definition
If you have Resharper AND Productivity Power Tools, by default this will cause ctrl + click to go to definition AND peek the definition. Very annoying. The solution from #SnowFatal will turn off the peek functionality. Resharper's option is listed as "Go to Declaration on <Control + Left Click> in the editor".
In the latest version of Visual Studio 2017 (15.4.0) it is:
Tools→Options→Text Editor→General→Enable mouse click to perform Go to Definition
You can either disable it by unchecking the box, or set a different key to trigger the mode.
Ctrl + Click -> Peek Definition is actually enabled by Productivity Power Tools. If you disable "Ctrl + Click Go To Definition" in Productivity Power Tools options then this behaviour will disappear.
For Visual Studio 2017 it is:
Tools→Options→Productivity Power Tools→General→Control click shows definitions in Peek

What's the equivalent for eclipse's ALT+UP/DOWN (move line) in Visual Studio?

In Eclipse, selecting a line and pressing Alt + ↑/↓ will move the line up and down, a quick way to avoid copy&paste.
Is there an equivalent in Visual Studio?
In Visual Studio 2013 and later, this functionality is built in. ALT + UP/DOWN will move a line up or down.
If you need this functionality in VS2012 (works with VS2010 too), take a look at the MoveLine Visual Studio Extension or the Productivity Power Tools suite.
ReSharper's Ctrl + Shift + Alt + ↑/↓/←/→ is even more powerful - when on the beginning of the line, it will move the entire line, but can also be used to move entire methods, change the order of parameters, etc.
For me in Visual Studio 2019 it comes default closed.
For open it:
Tools -> Options -> Keyboard then select Edit.MoveSelectedLinesUp, click "Press shortcut keys" input and press Alt + Up (or whatever you want for it). And the other one is Edit.MoveSelectedLinesDown, click "Press shortcut keys" input and press Alt + Down (or whatever you want for it).
This is now working out of the box with Visual Studio 2013, same way as in Eclipse.
For Visual Studio 2013:
Tools -> Options -> Keyboard then select Edit.MoveSelectedLinesDown, click "Press shortcut keys" input and press Alt + Down. You also have to select the scope of the shortcut to be within "Text Editor".
In Visual Studio 2013 and later, you can move lines up and down using Alt + ↑ / Alt + ↓. Unfortunately this will not adjust the indentation if you move between blocks, as of today only ReSharper (and all other IDE's by Jetbrains including Rider) can help you with that.
To move entire blocks of code around you can move the cursor to its head and press Ctrl + m twice fast to collapse it, and then use the command above to move it around.
Here is a neat reference to all default keyboard shortcuts in different versions of Visual Studio.
With the VSCommands extension, you have exactly that keyboard shortcut. And, by the way, a Stack OVerflow notification toolbar :)

Resources