46

I'm very used to having Ctrl-click select the word below my cursor and in Eclipse the authors seem to think it's better to make it move to the definition. I disagree, but can't find how/where to fix this. Searching on the internet and on here as well leads to hundreds of people wanting Eclipse-style Ctrl-click everywhere - I want to get rid of it.

How?

udondan
  • 57,263
  • 20
  • 190
  • 175
dascandy
  • 7,184
  • 1
  • 29
  • 50
  • I'm guessing you were coming from something other than Windows, because (just FYI) in Windows the standard way to select a word is double-click (or Shift-Ctrl-arrow), and the standard way to follow links is either click or (as in MS Word TOCs), Ctrl-click. But I'm glad to see that the answer below was helpful to you and others (who appear to be coming from vim). – Jon Coombs Mar 30 '14 at 06:53
  • 3
    This was coming from Visual Studio. – dascandy Mar 31 '14 at 12:55

3 Answers3

62

Go to Window - Preferences - General - Editors - Text Editors - Hyperlinking preference page,

uncheck the option Open Declaration

Kane
  • 8,035
  • 7
  • 46
  • 75
  • 1
    Thanks! that resolves the most annoying part. I still need to get the selection working... – dascandy Dec 23 '10 at 09:36
  • 1
    Thank you very much. Disabling `Hyperlinking` fixed a couple second freeze that occurred every time I did a copy / paste, presumably due to the `Default modifier key` being set to `Ctrl`. – theblang Nov 29 '12 at 21:06
  • This allowed to put a nice binding for CTRL+], so now I can follow links as I would do with vim + ctags. – Dacav Oct 11 '13 at 15:06
  • @mattblang : my understanding is that the copy/paste delay issue was indeed related to Ctrl, because the first use of Ctrl was triggering the following: "In order for Ctrl+Click to work, CElementHyperlinkDetector has to determine if there is navigable symbol at the current cursor location. In order to do that CElementHyperlinkDetector needs an AST. AST takes considerable time to build. The behavior before 7.0.1 was to wait for the AST to be built whenever Ctrl key is pressed." (https://bugs.eclipse.org/bugs/show_bug.cgi?id=326418) Sounds fixed now. – Jon Coombs Mar 30 '14 at 06:47
  • 1
    This didn't do it for me, so I disabled the entire section. – AStopher Apr 03 '16 at 14:54
7

For the selection part:

I use AutoHotKey with the following script:

#IfWinActive ahk_class SWT_Window0
^~LButton::Send !+{Up}

The first line makes sure the macro is only run when eclipse (SpringSource Tool Suite in my case) is active. Use AHK's built-in 'Window Spy' to check the window class for different IDEs.

The second line sends Alt+Shift+Up (default select word shortcut) when you Ctrl+Click in the IDE

udondan
  • 57,263
  • 20
  • 190
  • 175
Ronan
  • 79
  • 1
  • 1
-2

Close Eclipse.

Delete: /path/to/workplace/.metadata/.plugins/org.eclipse.jdt.core

Open eclipse and let it rebuild its indexes. Job done.

  • 8
    This could use a bit more explanation. I'm not sure everyone will feel comfortable with just deleting some file called "org.eclipse.jdt.core" without knowing whether or not is has any other side effects. – Matthijs Wessels Mar 18 '15 at 12:10
  • @Jaseem I guess this is a way to get "Go to Declaration" to work properly, not how to disable it, as the OP requested. I'm downvoting for that. – jpaugh Jun 14 '17 at 19:11