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

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

Related

How to disable the "go to definition" on pressing CTRL key in Visual Studio?

I usually use the CTRL+click combination to select one word, but in Visual Studio 2017 (15.4) when I press CTRL the word is turned into a hyperlink that goes to its definition, I want to disable it:
Tools->Options->Text Editor->General
Uncheck Enable mouse click to perform Go to definition
It will work
This setting has no effect when the "Ctrl+Click Go To Definition" Extension from Microsoft Marketplace is installed. The setting specified on the extension documentation page wasn't visible in the Options, Productivity Power Tools, Other Extensions, and hence, masked the real problem. Uninstalling the extension allows reverting to classic Ctrl+Click select behavior.

Create Visual Studio Keyboard Shortcut that include Mouse Click

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.

Visual Studio 2015: Disable Control+Click Navigation

After upgrading to Visual Studio 2015, holding control while clicking on a symbol navigates to that symbol definition. In prior versions, this would instead select the entire word.
How can I disable the navigation event when CTRL + Click(ing) a symbol, so that it highlights the word?
I do have Resharper (Ultimate 9.2) installed. The configuration option under Environment -> Search & Navigation -> Go to Declaration on Control + Click in the editor is not checked.
All the search engine results make mention of this being a feature of the Productivity Power Tools extensions in previous versions of Visual Studio. I do not have that extension installed.
I found my solution in the "Options - Text Editor - General" settings. This was on VS 2017 thou.
To disable navigation to symbol definitions in VS2015,
this one worked for me.
With Resharper Ultimate 2016.3.1, I could fix the issue by disabling "Rich mouse navigation in the editor". It can be found in Resharper Options window, under Environment > Search & Navigation.
Maybe updating Resharper could solve the issue.
Also, Productivity Power Tools is not installed on my machine.
In vs 2017 this setting is available in Tools -> Options -> Text Editor -> General -> Enable mouse click to perform Go to Definition.
You can uncheck it!
Go to ReSharper Options > Environment > Search & Navigation, then uncheck the following options:
Rich mouse navigation in the editor
Enable 'Smart go to declaration'
I finally solved it following the info I found on this page..
edit
Ensure you are using Visual Studio as your resharper keyboard scheme.
Environment -> Keyboard & Menus
Tools -> Options -> Environment -> Keyboard
To stop the go to declaration, select it and input a new key short cut for it. In this image I have demonstrated that I changed this short cut to ctr num 1 and could not change it to ctr num 3. On testing crt click does not no take me to the declaration.
Find the shortcut you want to remove, in this case Edit.NavigateTo and remove.
An update for Productivity Power Tools + VS2017. Instead of having settings for this feature, a separate plugin gets installed. So after installing PPTs, you'll have a new extension called Ctrl+Click Go To Definition. Not sure why we need that tool considering it's baked into VS, but...
Anyway, Disabling that extension (plus the other things mentioned in other comments for VS and Resharper) fixed my ctrl+click woes.
To switch to the Visual C# keyboard mapping scheme
On the Tools menu, click Options.
Expand Environment, and then click Keyboard.
Select Visual C# 2005 from the Apply the following application
keyboard mapping scheme drop-down list.
or you can do
Keyboard: CTRL + W
also plugin can be used
Keyboard Shortcut Exporter
you can import/export keymapping file

visual studio 2010 "surround with" hijacked by "pex and moles"

After I installed "Pex and Moles", used for automated testing, my "Surround with" (ctrl + k, s) in Visual Studio 2010 has been "hijacked" by the new add on.
This means I can only choose to insert a "PexClass for MSTest", which is kind of annoying since I use surround with many times each day.
Hope someone can help to reset this feature to its original functionality without removeing Pex and Moles.
Open the menu Tools -> Options
Then select Environment -> Keyboard
In the shortcut field, press CTRL+K, S. You'll see all bindings for this combination. Adjust or remove the ones you don't like.

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