Top 10 Eclipse Hotkeys

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.

29 Comments on "Top 10 Eclipse Hotkeys"

Notify of
avatar
Jeff Sheets
Guest

You forgot Ctrl+Shift+/ for instantly toggling comments!

Chris
Guest

Using alt+arrow keys to move to previous/next used files is much better than Ctrl-F6

John
Guest

Try, Ctrl+E for me it is better than Ctrl-F6

trackback

[…] The Programming Kung-Fu blog by Martin Ankerl discussed the use of hot-keys in Eclipse. He listed ten that he has found useful, based on his software development experience: […]

Musk
Guest

Forgot Ctrl + O for Quick Outline

Marko Schulz
Guest

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)

Sebastian Schaffert
Guest

F3 is a very nice one as well. Put the curser over some method and it will bring you to its declaration.

K.C.
Guest

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.

K.C.
Guest

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/

Alesssandro
Guest

I like F3 – to go to declaration code. Useful on large projects.

trackback

Eclipse Shortcut Kung Fu…

Martin has posted a nice entry in his blog “programming kung fu” about eclipse hot keys.

I think the most important key is ctrl-shift-L, which gives you a list of all shortcuts. A shortcut I often can not remember, when I am searching fo…

OlafK
Guest

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)

martinus
Guest

Nice trick, OlafK. This is also very useful in Linux since Ctrl+F6 does not work there at all (at least in KDE).

miheys
Guest

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).

Thomas A
Guest

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?

Chetan
Guest

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

trackback

[…] 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. […]

SureshKrishna
Guest

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.

Ganesh
Guest

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.

Vadim Motorine
Guest

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).

shifty
Guest

My favorite eclipse hotkey is alt-F4 to enable “god mode” and all cheats. Works like a dream 🙂

trackback

[…] this list starts with another top 10 list, namely Top 10 Eclipse Hotkeys. This article from 2006 has just made it onto this top list. With 3,302 pageviews it seems that […]

linuxtuts
Guest

Great post. These are the most used shortcuts and using them saves a lots of time.

Linux Rocks!
Guest

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.

chaitanya
Guest

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.

leon
Guest

very cool post, this will save each coder much time.

Lean
Guest

With, AltGr + down arrow -> Copy the line.
Thanks

hansi
Guest

Shift + Alt + A -> toggle block mode / write vertical / edit + insert a block in a squere

Best
Guest

Thanks!
I like short cut CTRL + Shift + F , which indent code.

wpDiscuz