Eclipse's Ctrl+click in Visual Studio?

Visual StudioEclipseKeyboard ShortcutsUsability

Visual Studio Problem Overview


After working for a few days with Eclipse Java I totally got addicted to pressing Ctrl and clicking on an identifier to go to its definition. Since then I've been looking for a way to achieve this in Visual Studio as well.

I realize VS has right click, Go to definition, and that F12 does the same. I also realize that Visual Assist does something similar with Alt + G. Yet none of these are as perfect as Ctrl + click.

I've actually tried my luck for a few hours trying to write a VS plugin to do it but didn't get anywhere in the time frame I thought reasonable for this.

Does anyone know how this could be achieved? A ready plugin? A macro of some kind?

Visual Studio Solutions


Solution 1 - Visual Studio

If you use Visual Studio 2010, you can use the free Visual Studio 2010 Productivity Power Tools from Microsoft to achieve this.

Solution 2 - Visual Studio

I use visual studio 2013 and 2015, I installed Go To Definition. To install this extension navigate on TOOLS -> Extensions and Updates.

enter image description here

Solution 3 - Visual Studio

I'll answer the commentors who asked about the difference between Ctrl-click and F12.

Ctrl-click workflow:

  • Move hand to mouse
  • Move mouse to hover over variable name
  • Other hand holds down Ctrl key while you click
  • Move mouse to position cursor, highlight, right-click, or whatever
  • Move hand back to keyboard to continue typing

F12 workflow

  • Move hand to mouse
  • Mouse mouse to hover over variable name
  • Move hand back to keyboard
  • Hit F12 key
  • Move hand back to mouse
  • Move mouse to position cursor, highlight, right-click, or whatever
  • Move hand back to keyboard to continue typing

If you assume the cursor is already positioned on the desired variable, F12 is better. However, that's rarely the case. Also, if you stop after this specific action, assuming you want hands back at the keyboard, the cost is the same. But if you keep in mind that you probably had a reason for wanting to go to the definition, the Ctrl-click workflow saves you an instance of moving between the keyboard and mouse.

Solution 4 - Visual Studio

Visual Assist supports Ctrl+Click as of June 2009 (build 1727). Activate Ctrl+LeftClick in VA Options | Advanced | General. (See the comment below.)

Solution 5 - Visual Studio

If you have Visual Studio 2010 you can use "Go To Definition" by Noah Richards.

http://visualstudiogallery.msdn.microsoft.com/en-us/4b286b9c-4dd5-416b-b143-e31d36dc622b

Solution 6 - Visual Studio

I use the built in options (F12, Right-click -> Go to definition) but I know a lot of the guys at my company use Resharper and it definitely has this functionality.

Solution 7 - Visual Studio

oh man, just install resharper!! (vs plugin) with it installed you just go and Ctrl + click to go to definition.

this is not the only thing resharper does, try it out free!!!

Solution 8 - Visual Studio

Microsoft released a Visual Studio 2010 extension named "Productivity Power Tools" which now adds Ctrl+Click functionality. So if you're like me, and hate installing third-party addons, you can now have the same functionality!

Solution 9 - Visual Studio

Another option with VS (besides F12 and right-click > Go to Def) is add the code definition pane (View > Code Def Window). This is essentially another editing pane that shows the code for the current symbol - no need to Ctrl-click or anything. I keep it pinned to my secondary monitor. Any time I need to see the implementation for a symbol I just click it and look over.

Another nice thing about F12 is you can also do ShiftF12 to find references to a symbol and F8 through them. The two go together like love and happiness.

Solution 10 - Visual Studio

I prefer to bind Go To Definition to CtrlD. This makes it extremely easy to use either with both hands on the keyboard (CtrlD to go tho the definition of the symbol under the cursor) or one hand on the keyboard and one hand on the mouse (Click on a symbol, then CtrlD).

Solution 11 - Visual Studio

All in all, both VS and Eclipse have weird key shortcuts. I just had to respond, too: F12 is far too right on the keyboard and you have to leave the the mouse right hand for the keyboard to use it. As a long time VS user I just didn't find it until I searched for the Ctrl+Mouse equivalent in Eclipse. It's completely borked. OK? No need to argue. (The same goes for F3 in Eclipse going for definition. ???? Why the face??? It's FIND NEXT for Pete's sake. But this can be removed after mastering the Eclipse keyboard shortcut system in the course of a few years.)

Anyway, as has been said here before, Microsoft has already understood this can be an issue for new programmers coming in from Eclipse, so they provided the Power Tools (I followed the link up above).

http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/

Solution 12 - Visual Studio

If you are using Visual Studio 2017, you can use Productivity Power Tools 2017

Solution 13 - Visual Studio

I don't work in VS much, so I haven't used it, but I've heard incredibly good things about Resharper from everyone I know who does. Everyone has told me it's worth every penny, and significantly improves efficiency in Visual Studio. I think it has a feature like what you're looking for, along with a TON of others.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionshooshView Question on Stackoverflow
Solution 1 - Visual StudiosplintorView Answer on Stackoverflow
Solution 2 - Visual StudioSe SongView Answer on Stackoverflow
Solution 3 - Visual StudioJoel CoehoornView Answer on Stackoverflow
Solution 4 - Visual Studiosean eView Answer on Stackoverflow
Solution 5 - Visual Studiomhenry1384View Answer on Stackoverflow
Solution 6 - Visual StudioDanny TuppenyView Answer on Stackoverflow
Solution 7 - Visual StudioDiegoView Answer on Stackoverflow
Solution 8 - Visual StudioDanny TuppenyView Answer on Stackoverflow
Solution 9 - Visual StudioJustin R.View Answer on Stackoverflow
Solution 10 - Visual StudioMartyView Answer on Stackoverflow
Solution 11 - Visual StudiodavidView Answer on Stackoverflow
Solution 12 - Visual StudioAkbaritabarView Answer on Stackoverflow
Solution 13 - Visual StudioHermsView Answer on Stackoverflow