Is there a hotkey in Eclipse to "Open declared type"? - eclipse

When hovering over a variable, one can go straight to its definition pressing F3. But what I'm looking for is for a way to go directly to its type definition, which I'm currently doing by pressing CTRL + clicking "Open declared type".
Is there a easier way to do this?

Assign a key stroke for 'Navigate > Open Hyperlink' command via 'Preferences > Keys'. (I use F6)
Now you can use this key stroke instead of using Ctrl+Click to bring up the hyperlink popup.
Not exactly what you are looking for, but this is the best solution I think.

There is another option, using Ctrl+Shift+t. This opens a window where you can look up any type you wish. This becomes a shortcut when you highlight your target, press Ctrl+Shift+t and hit enter. Imho Ctrl+Click is still faster.
If you would like to check any other shortcuts bind keys go to Windows -> Preferences -> General -> Keys

I've always relied on a combination of ctrl+shift+t and the hover options. I never thought of the key stroke assignment. I might try mapping a scroll button click, like opening a link in a new tab.

in Windows > Preferences > Keys
search for Go to Type and assign it a ctrl-f3 or shift-f3 (there is a conflict with ctrl-f3)

Related

Eclipse Short Cut: File Search

I have looked and looked but I cannot find a shortcut for "File Search" in Eclipse.
I even downloaded the mousefeed plugin. (It is pretty cool whenever you do something with the mouse. A little popup comes up and tells you how you could have done that with a shortcut. Not super useful but somewhat useful.)

			
				
ctrl + H opens the search dialogue box. Click on customize and check the option 'Remember last used page'. First time you have to select the tab file search and perform a search. After that if you press ctrl + H , it will automatically point to file search tab.
There is none, but if you go to Windows - Preferences - General - Keys, and type File search in the filter text box, you'll then be able to select the File search action, and type your own key binding.
You can change all shortcut keys in eclipse for instance:
Window -> Preferences -> General -> Keys -> search: File Search -> Binding -> *what ever key combination you like.

What are the shortcut keys to change to the next and previous tab in Eclipse on Mac OS X?

I want to be able to switch from one file to another in the Eclipse editor (in the Java perspective) from the keyboard (and bind those key combinations to buttons on my mouse). What are the shortcut keys for switching the current tab to the next or previous?
Mac OS X:
Fn+Cntrl+↑
Fn+Cntrl+↓
Effectively Cntrl+page up/page down as given in the first comment for #wibbe01's answer.
According to this thread, switching editors are:
Shift+Command+F6
Command+F6
, which you can remap to:
Shift+Command+Tab
Command+Tab
Note, as mentioned in that same thread:
Command+E lists all the opened editors, allowing to quickly select one
Shift+Command+L lists all the active key bindings.
The bug 86248 helped introduced the Cntrl+↑ and Cntrl+↓, which Bjorn Tipling reports working on Mac with a Fn in front of it.
If I were you I would just go to the eclipse menu, then preferences. Under the general section of the tree there is a section called "Keys" In there you will find things for "Next Editor" or whatever other keyboard shortcuts you are looking for. Map them to what makes sense to you....then you're happy like this :) or maybe even like this :D.
Enjoy.
In Eclipse's preference panel, go to Keys. The command is called Next Tab and Previous Tab, just map these to whatever you want. In my case since I normally use mvim are:
⌘+⇧+[
⌘+⇧+]
You can change all shortcut keys in preferences by pressing ctrl+shift+L 2 times . Switching tab in Eclipse (ctrl+F6) is not easy to press. So you can make it ctrl+tab or whatever you want.
Since I have my F keys mapped to the default setting, I had to use fn-command-F8
I figured it out by first confirming command-F8 was indeed mapped under command-shift-L

How to navigate up/down using keyboard home keys in Eclipse's suggestions pop up window?

When Eclipse shows a popup for code completion, how do you change the highlighted option using the keyboard home keys? Currently, if the thing I want is third or fourth on the list of suggestions, I have to use the mouse to select it, or use the arrow keys. Is there a way to use the keyboard home keys/ shortcuts with ctrl/alt to do this?
Arrow keys always work for me. Can you be little more specific as to what perspective, editor, etc?
I get a code completion popup when I press Ctrl + 1 in the Java editor. From then on, I can use the arrow keys to navigate.
I'm assuming you want to select from the code completion menu by X for up and Y for down. Go to Preferences > Keys and bind the commands Line Up and Line Down to X and Y, respectively. Make sure that in the When drop-down you select In Windows.
Note that after the settings are applied, X (Y) also makes the cursor go one line up (down) in the source editor. Personally, I use X = Ctrl+P and Y = Ctrl+N which means I can navigate lines and select entries from the code completion menu without lifting my hands off the keyboard.
Unfortunately, these bindings don't work with other pop-up lists in Eclipse, e.g. quick outline (Ctrl+O) or quick access (Ctrl+3). I'd love to find out how to bind these too.

Eclipse C++: How do you quickly switch between header and implementation files?

How do you switch between header (.h) and implementation files (.cpp) in Eclipse when using the C++/CDT environment with a keyboard shortcut?
In XCode you can quickly switch between headers and implementation with applekey option and up/down arrow keys. I was hoping that eclipse had something similar, but I haven't found it yet.
Ctrl + Tab.
See in menu Window --> Preferences --> "General" category (far left) --> Keys --> "Toggle Source/Header"
Ctrl + Tab is the default shortcut and here is a list of some of the more useful shortcut keys in Eclipse.
Ctrl + Tab is the default shortcut. You can change it in Window->Preferences->General->Keys - Toggle Source/Header
F3 to jump between declarations and definitions of specific methods
This is another good one to know in this context:
double click on the method name with the mouse, selecting it
hit F3 (shortcut for Right Click > Open Declaration)
This takes you from the declaration (.hpp) to definition (.cpp) and vice versa depending on which one you are currently in, which is useful if you want to go to the other file to see a specific method when the file is large.
Tested in Eclipse CDT 2019-09.
You can also Ctrl + click on an identifier ( method name of member,... ). That way you seldomly need Ctrl + Tab.

How do I hotkey directly to File Search tab in Eclipse

When I use CTRL+H I end up on the Java Search tab. I would very much like a shortcut to go directly to File Search instead. Is that possible?
See image here for what I'm talking about:
You can just define a key binding that opens the file search:
Go to Preferences > General > Keys
Type "file search" in the search box. (If there are no results, and you have a really old Eclipse version, select the Include Unbound Commands check box.)
Put the caret into the Binding text box and press the key combination you want to use:
You can either re-use the CTRL+H binding (delete the other binding in that case) or define another one (e.g. CTRL+SHIFT+H). To delete the other binding search for "Open Search Dialog" and click on Unbind Command.
Other solution: You could press CTRL+3 in your editor, type in "file s", press Enter. The next time you press CTRL+3 "File Search" is at the top.
Another option is to open the search dialog (Ctrl+H) then click customize and hide java and task search tabs, next time you do Ctrl+H, file search will be the only one showing, thus it will be selected by default
I actually think the best (and easiest way) is to simply open the search dialog (ctrl + h), hit customize, and then select the checkbox for "Remember last page used." Then tab over to the File Search once. So long as that is the last search tab you used, it will always open there. The advantage to this is that you don't lose easy access to the other tabs, should you actually need them! (working in Eclipse Kepler).
I learnt to use a "pseudo-hotkey" ALT+A F (works also as ALT+A ALT+F), which resolves to: "Menu Se[a]rch → [F]ile..." and has the advantage of being always present, without need for reconfiguration.
I've run into this problem before, too.
I tried following the advice in the question response given by #Martin to rebind Ctrl+H to "File Search" in Window | Preferences | General | Keys, but for some reason, I don't have a "File Search" entry in the Command column. (I'm running Eclipse 3.3 currently; maybe the "File Search" entry was added in a subsequent release?)
Update: As Martin pointed out in a comment on this answer, I didn't have the "Include unbound commands" checkbox checked in the Preferences | Keys dialog, which is why "File Search" wasn't showing up for me. I now have Ctrl+H bound to "File Search", as Martin suggested in his answer on this page, and it works great. Thanks Martin!
I ended up working around the original problem by bringing up the Search dialog with Ctrl+H, then clicking the Customize button on the dialog, which brings up a "Search Page Selection" dialog which allows you to hide or show tabs on the Search dialog. I hid the tabs other than "File Search," which causes "File Search" to be activated by default on future uses of Ctrl+H.
As far as I know, the search window tab depend of the open file you're on when calling the search function. So, for example if your on a web.xml file, it will open the "plug-in search" instead of the "java-search".
Edit: there is a way to force the default open tab, by assigning a shortcut to the "File Search" action in the "Keys" preference panel.
Probably this feature came recently [confirmed its there in since Juno] and looks intelligent.
Press Ctrl+H --> Customize --> [Checkbox] Remember last used page.
This way you are not far from other options if required anytime. So if you use File search often then you will not get annoyed getting what you last chose.
I would like to provide a workaround here:
you can 'remember last used page' to avoid opening it over and over again.
UPDATE: user #muescha, in the comments underneath the question, just pointed out to me that I accidentally answered the wrong question! Nevertheless, it is still a valuable answer (just not to this question), so I'm leaving it.
My answer answers the question: How do I use a hotkey directly to search for a File in Eclipse?
Ctrl + Shift + R works fantastically! Use asterisks (*) for wildcards. It is very similar to the Ctrl + P fuzzy search in Sublime Text 3.
Sample searches using the Ctrl + Shift + R "Open Resource" search in Eclipse:
rea
*.txt
*32*f1*c
*3*1*c*h
Notice if you just put an asterisk * between every character in the search string it works just like Sublime Text 3's Ctrl + P "fuzzy search"! Beautiful!
Side note: you can also use the Search --> File menu dialog to search for files.