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.

26 Responses to “Top 10 Eclipse Hotkeys”

  1. Jeff Sheets on July 20th, 2006 6:22 pm

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

  2. Chris on July 20th, 2006 6:43 pm

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

  3. John on July 20th, 2006 8:42 pm

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

  4. The Rashad’s Zone » Organization For Eclipse Developers on July 20th, 2006 10:37 pm

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

  5. Musk on July 22nd, 2006 2:25 pm

    Forgot Ctrl + O for Quick Outline

  6. Marko Schulz on July 25th, 2006 12:22 pm

    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)

  7. Sebastian Schaffert on July 27th, 2006 10:34 pm

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

  8. K.C. on July 28th, 2006 6:28 am

    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.

  9. K.C. on July 28th, 2006 6:29 am

    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/

  10. Alesssandro on July 28th, 2006 3:13 pm

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

  11. Myndian.de on August 1st, 2006 12:18 pm

    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…

  12. OlafK on August 1st, 2006 1:49 pm

    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)

  13. martinus on August 3rd, 2006 3:26 pm

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

  14. miheys on August 8th, 2006 9:53 pm

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

  15. Thomas A on August 10th, 2006 12:44 am

    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?

  16. Chetan on August 14th, 2006 8:22 am

    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

  17. .bootstrap » Top 10 Eclipse Hotkeys on September 6th, 2007 8:21 pm

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

  18. SureshKrishna on September 16th, 2007 8:36 pm

    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.

  19. Ganesh on December 31st, 2007 9:44 am

    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.

  20. Vadim Motorine on January 6th, 2008 12:41 pm

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

  21. shifty on March 28th, 2008 5:50 pm

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

  22. Martin Ankerl » Blog Archive » Top 10 Posts of 2008 on December 27th, 2008 7:08 pm

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

  23. linuxtuts on December 28th, 2008 10:50 pm

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

  24. Linux Rocks! on April 25th, 2009 7:42 pm

    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.

  25. chaitanya on August 21st, 2009 12:54 pm

    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.

  26. leon on February 1st, 2010 8:27 am

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

Leave a Reply