Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Visual Studio 2008, how can I make control+click do a "Go To Definition"?

In the Delphi IDE, you can hold control and click on a method to jump to its definition. In VS2008, you have to right-click and select "Go To Definition".

I use this function quite often, so I'd really like to get VS to behave like Delphi in this regard - its so much quicker to ctrl+click.

I don't think there's a way to get this working in base VS2008 - am I wrong? Or maybe there's a plugin I could use?

Edit: Click then F12 does work - but isn't really a good solution for me.. It's still way slower than ctrl+click. I might try AutoHotkey, since I'm already running it for something else.

Edit: AutoHotkey worked for me. Here's my script:

SetTitleMatchMode RegEx
#IfWinActive, .* - Microsoft Visual Studio
^LButton::Send {click}{f12}
like image 510
Blorgbeard Avatar asked Sep 17 '08 07:09

Blorgbeard


People also ask

How I can make Ctrl Click to go to definition in Visual Studio code?

Tip: You can jump to the definition with Ctrl+Click or open the definition to the side with Ctrl+Alt+Click.

How do I enable definition in Visual Studio?

If you are a keyboard user, place your text cursor somewhere inside the symbol name and press F12. If you are a mouse user, either select Go To Definition from the right-click menu or use the Ctrl-click functionality described in the following section.

How do you go back from go to definition in Visual Studio?

All replies. In addition to the arrow on the far left of the main toolbar, you can use Ctrl- ('Ctrl' and the minus key).

How do you jump to a function in Visual Studio?

For jumping to function in currently opened file use Ctrl+Shift+O . From docs: You can navigate symbols inside a file with Ctrl+Shift+O.


2 Answers

Not for Visual Studio 2008, but if you upgrade to Visual Studio 2010, you can use the free Visual Studio 2010 Pro Power Tools from Microsoft to achieve this.

like image 134
splintor Avatar answered Oct 18 '22 18:10

splintor


You could create an Autohotkey script that does that. When you ctrl-click a word, send a doubleclick then a F12.

I don't have AHK handy so I can't try and sketch some code but it should be pretty easy; the AHK recorder should have enough features to let you create it in a point 'n' click fashion and IIRC it is smart enough to let you limit this behaviour to windows of a certain class only.

When you have your script ready just run the script in the background while you code. It takes just an icon in the Notify bar.

like image 42
badp Avatar answered Oct 18 '22 18:10

badp