Eclipse has lots and lots of hotkeys, but for daily work you need only a small subset. This are the hotkeys I consider to be the most important time savers:
Moving around
- Ctrl+J — Incremental Search
- Ctrl+Shift+T — Search a type, with search on typing. You can use only the upcase letters (e.g. type “MIL” to find MouseInputListener)
- Ctrl+F6 — Switch between last used files
- F3 — Open declaration
- Ctrl+Alt+H — Open Call Hierarchy
Editing
- Ctrl+1 — Quick Fix: press while cursor is positioned at member variable, parameter, selection, warnings, errors, …
- Ctrl+Space — Context Assist: press after a ., or to use macros (for, while, sysout, …). Press in class-scope to automatically create method declarations.
- Ctrl+Shift+O — Organize Imports
- Ctrl+Shift+F — Reformat source
- Alt+Shift+T — Show Refactor Quick Menu
In case these hotkeys are not enough or you have forgotten which hotkey does what, you can always press Ctrl+Shift+L to get a nice list of all the hotkeys.
You forgot Ctrl+Shift+/ for instantly toggling comments!
Using alt+arrow keys to move to previous/next used files is much better than Ctrl-F6
Try, Ctrl+E for me it is better than Ctrl-F6
Pingback: The Rashad’s Zone » Organization For Eclipse Developers
Forgot Ctrl + O for Quick Outline
Besides the ones above I also use very frequently:
Alt+Shift+S: show the Source menu (the little brother of Alt+Shift+R)
Ctrl+Shift+R: search for a Resource (the bigger brother of Ctrl+Shift+T which I summon if I e.g. look for a XML file)
Alt+Shift+Up: Expand Selection to enclosing element (saves me many times from leaving the keyboard to grab the mouse)
F3 is a very nice one as well. Put the curser over some method and it will bring you to its declaration.
It’s not native to Eclipse, but the Implementors plugin gives you Alt-F3, which takes you to the _implementation_ of the item under the cursor. So instead of taking you to List.add(), it would offer you the choice of ArrayList.add() and LinkedList.add(). If there’s only one choice, it jumps straight to it.
Oops, I didn’t think the hyperlink would go with my name. I have nothing to do with the Implementors plugin, just a happy user.
http://eclipse-tools.sourceforge.net/implementors/
I like F3 – to go to declaration code. Useful on large projects.
Pingback: Myndian.de
On Windows-Machines, change Ctrl+F6 (Switch between last used files) to Alt-q. So it is close to Alt-Tab (Win: Switching Programms) This tip is from E.Gamma (i meet him at the JAX)
Nice trick, OlafK. This is also very useful in Linux since Ctrl+F6 does not work there at all (at least in KDE).
It is nice to rename something at once everywhere in a file (Ctrl + 2, R).
Running JUnit/PDE test (Alt + Shift + X, T)/(Alt + Shift + X, P).
CTRL+J is great for incremental find. Did you know you can press it twice to search again for the search term you used before?
How to change the key for switching editor to Ctrl+Tab like in Firefox. I am using Eclipse 3.2 and in that somehow original key does not get changed
Pingback: .bootstrap » Top 10 Eclipse Hotkeys
Hi Martin : Its a very good list too. Ya….as you said we probably we need to collate rest of the popular shortcuts and add them to TOP 100
. But its really interesting to see which shortcuts are frequently used by others.
Eclipse is a very popular Java development environment, IDE and it has a lot hotkeys to remember. Here is a blogger’s day to day use top 10 eclipse hotkeys.
Thanks a lot. Without your post I would have probably still believed that Eclipse is not suited for serious work. I am actually a C++ programmer and a casual Eclipse user.
When I press ctrl+shift+f6 and see the explanation that ctrl + F6 is the “Next Editor” for me it is difficult to guess that this actually means the list of opened windows (most often in the same editor).
My favorite eclipse hotkey is alt-F4 to enable “god mode” and all cheats. Works like a dream
Pingback: Martin Ankerl » Blog Archive » Top 10 Posts of 2008
Great post. These are the most used shortcuts and using them saves a lots of time.
Hey Chetan,
Switching tabs firefox-style can be done with . I would suggest going into Window>Properties>General>Keys to change the hotkey to like it is in most Linux applications.
Excellent and very helpful Post .
thanx much
hello sir , can u please tell me , one short cut ,
if i want to compile a single .cpp or .c file in Eclipse ,
is thr any shortcut available for it ?
or else then short cut also if any method available in eclipse..
please tell me .
Thanx to All in Advance.
very cool post, this will save each coder much time.
With, AltGr + down arrow -> Copy the line.
Thanks
Shift + Alt + A -> toggle block mode / write vertical / edit + insert a block in a squere