109

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?

John Washam
  • 4,073
  • 4
  • 32
  • 43
  • 40
    I *despise* this "feature": it frequently pops up unexpectedly when I'm using the mouse to click on a word that I want to replace, and my left hand is readying to Control-V for pasting. I frequently end up renaming a class because my hands are faster than my vision. But I can't find any way to disable it. – sfuqua Jul 02 '14 at 14:54
  • @sfuqua I had the same issue, but even before - In my case it was due to a double assignment of the Ctrl+Click command. Both Resharper and the Power-Tools provide this feature and assigned it. So disabling the Powertools one solved the problem for me. – Efrain Feb 19 '15 at 08:34
  • 2
    most annoying when the definition is in the same file.. you get the definition often just a few lines from original – Sonic Soul Mar 30 '15 at 21:50
  • @sfuqua it's even worse when you accidentally do the same into a header only library and end up getting thousands of lines of errors that just look like jibberish. – will Oct 31 '16 at 11:13

5 Answers5

223

In pre 2017 Visual Studio:

ToolsOptionsProductivity Power ToolsOther ExtensionsControl click shows definitions in Peek

Adam Garner pointed out that in Visual Studio 2017, the location is:

ToolsOptionsText EditorGeneralEnable mouse click to perform Go to Definition

SnowFatal
  • 2,431
  • 1
  • 15
  • 12
  • 4
    I looked through all the settings and never saw this. This restores Ctrl + Click functionality to opening the full document instead of peeking. Thank you! – John Washam Aug 06 '14 at 19:12
  • 1
    Thanks! Really crappy function that seems to only work on my home pc and fail on my work PC. – Ben Pretorius Oct 01 '14 at 14:42
  • 3
    Praise be! foisting that Peek feature on us was just cruel – sming Oct 30 '14 at 15:15
  • 2
    Haha, it's amazing that such a small feature turns into big deal when you can't figure out how to turn it off. I know since I spent some time time trying to disable it, too. – SnowFatal Dec 04 '14 at 00:54
  • Adding a comment here for people who might be searching for Ctrl+Click with Resharper. I thought it was a Resharper setting, and had been searching for how to turn it off (I didn't know what the feature was called, I had to search for "Promote to Document" and reverse lookup that way). Thanks. – askrich Mar 26 '15 at 13:07
  • 3
    FYI, if you want to disable Ctrl+Click all together it's under Tools -> Options -> Productivity Power Tools -> Turn Extensions On/Off -> Ctrl+Click Go To Definition -- and you can just turn it off, but it requires a Visual Studio restart. – BrainSlugs83 Jun 30 '15 at 02:13
  • With JetBrains ReSharper installed, the Control click shows definitions in Peek option was not available. – rmirabelle Jul 30 '15 at 14:35
  • I had disabled Ctrl+Click in Productivity Power Tools and wasn't able to see this option. In this case, to see the option, you must first enable Ctrl+Click and then restart Visual Studio to see the option. – Rachel Martin Aug 12 '15 at 16:17
  • God I hate PPT. Custom Document Well is the only good thing in that addon. – Travis May 13 '16 at 03:15
  • It's moved in VS 2017. Check out @AdamGarner's answer below – Greg Jan 29 '18 at 01:36
  • Please also note that you need to check the setting under Productivity Power Tools as well (yes, in VS 2017). The setting is called `Control click shows definitions in Peek`. This setting exists in 2-3 different places, and any of them could cause the issue. – theMayer Nov 25 '18 at 22:17
17

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

Jason
  • 504
  • 6
  • 11
10

In the latest version of Visual Studio 2017 (15.4.0) it is:

ToolsOptionsText EditorGeneralEnable 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.

Adam Garner
  • 1,235
  • 10
  • 17
6

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.

AncientSyntax
  • 919
  • 8
  • 12
  • 4
    That removes the Ctrl + Click functionality entirely. I want to keep the Ctrl + Click functionality, but have it open up the document instead of opening the Peek Definition. This is what I haven't figured out how to do yet. I'm thinking it must not be possible in VS2013. – John Washam Jul 15 '14 at 14:13
  • 2
    F12 (plain old "go to definition") will open the definition in a new window - would that help? Same number of keystrokes, different order (click on the symbol, then press F12). – Mark Wilson-Thomas MSFT Feb 27 '15 at 02:00
  • This is the answer I was looking for -- didn't realize it was here, but the one above pointed me in the right direction -- wish I'd seen it first. I'm with you @MarkWilson-ThomasMSFT I would much rather push F12 to go to definition, then randomly be editing some other file because I was clicking and copying or clicking and pasting... (Ctrl + C, or Ctrl + V). – BrainSlugs83 Jun 30 '15 at 02:18
0

For Visual Studio 2017 it is:

ToolsOptionsProductivity Power ToolsGeneralControl click shows definitions in Peek

Fka
  • 6,044
  • 5
  • 42
  • 60
  • For some reason, after disabling this option in VS2017, it still does not work. – soccer7 Jul 30 '17 at 09:46
  • 1
    In 2017 to disable ctrl+click completely tou need to go to Tools->Exstensions and Updates and disable the control click go to definition extension – Greg Jul 31 '17 at 01:40