Alright it can be a lame question, but everybody uses these things differently. What's some of the best time savers out there for this IDE.
Tom
73 Answers
Don't forget Ctrl+Shift+L, which displays a list of all the keyboard shortcut combinations (just in case you forget any of those listed here).
-
1For the beginners who are using mac, Use COMMAND button instead of CTRL for all the commands listed here. I took time to figure this out. It might help someone. – 500865 Oct 23 '11 at 03:27
Ctrl-2 something
Seems that nobody mentioned Ctrl-2 L (assign to new local variable) and Ctrl-2 F (assign to a new field), these ones have changed how I write code.
Previously, I was typing, say (| is cursor location):
Display display = new |
and then I pushed Ctrl-Space to complete the constructor call. Now I type:
new Display()|
and press Ctrl-2 L, which results in:
Display display = new Display()|
This really speeds things up. (Ctrl-2 F does the same, but assigns to a new field rather than a new variable.)
Another good shortcut is Ctrl-2 R: rename in file. It is much faster than rename refactoring (Alt-Shift-R) when renaming things like local variables.
Actually I went to Keys customization preference page and assigned all sorts of additional quick fixes to Ctrl-2-something. For example I now press Ctrl-2 J to split/join variable declaration, Ctrl-2 C to extract an inner class into top-level, Ctrl-2 T to add throws declaration to the function, etc. There are tons of assignable quick fixes, go pick your favourite ones and assign them to Ctrl-2 shortcuts.
Templates
Another favourite of mine in my “npe” template, defined as:
if (${arg:localVar} == null)
throw new ${exception:link(NullPointerException,IllegalArgumentException)}("${arg:localVar} is null");
This allows me to quickly add null argument checks at the start of every function (especially ones that merely save the argument into a field or add it into a collection, especially constructors), which is great for detecting bugs early.
See more useful templates at www.tarantsov.com/eclipse/templates/. I won't list them all here because there are many, and because I often add new ones.
Completion
A few code completion tricks:
- camel case support mentioned in another answer: type cTM, get currentTimeMillis
- default constructor: in the class declaration with no default constructor push Ctrl-Space, the first choice will be to create one
- overloading: in the class declaration start typing name of a method you can overload, Ctrl-Space, pick one
- getter/setter creation: type “get”, Ctrl-Space, choose a getter to create; same with “is” and “set”
Assign To A New Field
This is how I add fields.
If you have no constructors yet, add one. (Ctrl-Space anywhere in a class declaration, pick the first proposal.)
Add an argument (| is cursor position):
public class MyClass { public MyClass(int something|) { } }
Press Ctrl-1, choose “assign to a new field”. You get:
public class MyClass { private final Object something; public MyClass(Object something) { this.something = something; } }
Add a null-pointer check if appropriate (see “npe” template above):
public class MyClass { private final Object something; public MyClass(Object something) { npe| this.something = something; } }
Hit Ctrl-Space, get:
public class MyClass { private final Object something; public MyClass(Object something) { if (something == null) throw new NullPointerException("something is null"); this.something = something; } }
A great time saver!

- 8,965
- 7
- 54
- 58
-
2
-
14
-
3@rsp Sorry, I hate inserting unneeded braces. Btw, Eclipse has code cleanup feature that can make your code use any style of braces (always or only when needed), and it can apply it on save. – Andrey Tarantsov Apr 01 '10 at 09:04
ctrl-shift-r and its buddy, ctrl-shift-t, to open a resource or type, respectively. Resources includes all files in your open projects (including non-java files), and types includes java types either in your projects, or in a library included in the projects.

- 36,513
- 30
- 103
- 141
-
6ctrl+shift+r is nice also for opening types when you just opened a project since it doesn't need indexing. – boutta Mar 17 '09 at 06:36
-
Good point. ctrl-shift-r won't work for opening types that are in referenced jar libraries, though; it will only work for individual files (resources) in your project. – pkaeding Mar 18 '09 at 21:29
-
This is certainly the most useful feature in Eclipse and one that's not so well implemented (i.e. slow) in Netbeans. – Rahul Jun 22 '09 at 05:07
Crtl+1 is my favorite. The quick fixes for the red-squiggles.
It is also located in the Edit Menu -> Quick Fix.
-
2Ctrl+. (period) take you to the next error (red/yellow squiggly)....With these two, you are in a error fixing mode. :D – st0le Dec 01 '11 at 14:02
Ctrl+Shift+O to organize imports, which will format them nicely, remove unneeded imports, and add missing imports.

- 22,896
- 10
- 72
- 102

- 44,224
- 30
- 113
- 140
-
6I noticed the other day that this can be used to organize the whole project or parts of it, not just one file as I had expected. Extremely useful. – Antti Kissaniemi Sep 12 '08 at 15:26
-
I'll try this, but does this change import java.util.* into the imports that you actually need? – Thomas Owens Sep 30 '08 at 19:22
-
It can change .* imports if you want - I believe it's configurable (a setting of how many classes to import before it switches to .*). – Darren Greaves Nov 19 '08 at 18:40
-
This little key combination was one of the main reasons I originally started using Eclipse. So helpful! – Rich Adams Jan 30 '09 at 12:34
-
11@boncey yes, it is configurable. Note that since Eclipse3.3 you can ask Eclipse to automatically organize import during saves (Java > Editor > Save actions) – Romain Linsolas Jan 30 '09 at 12:49
-
that's the thing I miss the most since programm with c# and visual studio 2008. – bernhardrusch Feb 27 '09 at 06:44
-
Ctrl-J starts an incremental find.
Hit Ctrl-J, then start typing. Use up/down to find previous/next instances of what you typed.
Ctrl-Shift-J searches backwards.

- 13,338
- 13
- 52
- 56
-
9in the same vein select a word and hit ctrl-k or ctrl-shift-k and it will iterate through the selected string occurences – Newtopian Jun 08 '10 at 12:00
-
@Newtopian - ctrl-k is one of the most useful shortcuts for finding references in a file quickly. – RodeoClown Jun 09 '10 at 00:39
Type 'syso' then press Ctrl+Space to expand it to System.out.println().
Tres handy.
- CTRL-SHIFT-g : finds usages of the method or field under the cursor, absolutely necessary for understanding code
- CTRL-F6 : navigate between the list of open editor windows, if you just type it once and let go you toggle back to the previous editor window, doing this successively is a nice way to jump back and forth
- CTRL-t : on a class or method will show you the type hierarchy, very useful for finding implementations of an interface method for example

- 10,858
- 8
- 45
- 59
-
1I use a 5 button mouse and map F6 to one of the buttons to make for quick navigation. – s_t_e_v_e Dec 31 '08 at 19:27
-
Many-button mice are underused that way. That's a good idea. I just worry I wouldn't learn the habit and if I did I would have trouble switching between machine (work desktop, work laptop, home desktop, etc) – Boris Terzic Jan 14 '09 at 14:58
-
1I know I can change it but I wish CTRL-F6 was something else by default. I can't hit it with one hand. – Albert Feb 27 '09 at 16:25
-
1F4 will also open the type hierarchy by default. Nice and conveniently placed next to F3, which jumps to the definition of whatever's under the cursor. – Mike Daniels May 18 '09 at 20:10
-
The one problem with ctrl-shift-G is that it searches for references in the entire workspace, current project would have been more useful to me... – Nils Weinander Jun 10 '10 at 11:45
-
5Remapping Ctrl-F6 to Ctrl-Tab is essential. Very natural to understand, since it's like changing tabs in your browser. – espinchi Jun 30 '11 at 13:28
Clicking on the return type in a method's declaration highlights all exit points of the method.
for instance:
1: public void foo()
2: {
3: somecode();
4: if ( blah ) return;
5:
6: bar();
7: }
clicking on void will highlight the return on line 4 and the close } on line 7.
Update: It even works for try{} catch blocks. If you put cursor on exception in the catch block and eclipse will highlight the probable methods which may throw that exception.

- 8,737
- 11
- 55
- 73

- 1,744
- 1
- 14
- 20
-
Now he tells me :) useful... especially when reading long terrible methods... – dstibbe Dec 17 '09 at 09:23
Code completion supports CamelCase, e.g., typing CWAR
will show a result for ClassWithAReallyLongName
. Start using this feature and you'll never type another long classname again.
(parts copied from another answer because i think answers w/ just one hint/tip are best for polling)

- 14,656
- 11
- 42
- 52
Alt-Up Arrow moves the current selection up a line, Alt-Down Arrow moves it down. I also use Alt-Shift-Up/Down Arrow all the time. Ctrl-K and Ctrl-Shift-K is quite handy, finding next/previous occurrence of the current selection (or the last Find, if nothing is selected).

- 265,237
- 58
- 395
- 493
There's an option to place the opening curly brace and a semicolon automagically in the "correct" position. You'll have to enable this - Choose Window/Preferences and type "brace" in the searchbox - should be easily findable (no eclipse on this computer). The effect:
- Typing a semicolon anywhere on the line will place it at this lines end (as in word/openoffice: Backspace if you'd like to have it in the original place)
- Typing an opening curly brace when you're just inside another pair of braces will place it at the end of this line - as in this example
("|" is the cursor):
if(i==0|)
typing "{" now will result in
if(i==0) {|

- 46,930
- 8
- 59
- 90
Hippie expand/Word Complete, afaik inspired by Emacs: will autocomplete any word in any editor based on other words in that file. Autocomplete inside String literals in Java code, in xml files, everywhere.
Alt + /
-
2
-
You can also alter the behaviour of Ctrl-Space to include Alt-/ -style text expansion – Ewen Cartwright Sep 15 '10 at 12:53
-
It's a little maddening that Eclipse settled on this shortcut but NetBeans settled on ctrl-e, though. – Tim Gilbert Aug 27 '09 at 22:15
Alt-Shift-R stands for rename, not refactor. Refactoring is a more general term (as defined by the book).
Nevertheless, it is one of my favorite refactorings. Others include:
Alt-Shift-M: Extract Method (when a code block or an expression is selected)
Alt-Shift-L: Extract Local Variable (when an expression is selected)
Extract Local Variable is especially useful when I don't remember (or bother to type) the result type of a method. Assuming you have a method JdbcTemplate createJdbcTemplate()
in your class, write some code such as this:
void someQuery() {
createJdbcTemplate()
}
Select the expression createJdbcTemplate()
, click Alt-Shift-L, type the name of variable and press enter.
void someQuery() {
JdbcTemplate myTemplate = createJdbcTemplate();
}

- 18,944
- 13
- 54
- 47
-
5note that the Alt-Shift-R rename does a "refactoring rename" rather than a "rename-in-file" – Scott Stanchfield Feb 26 '09 at 17:18
-
1To assign the method result to a variable, you can use Quick fix (Ctrl-1) as well, without even selecting the method call. – Jorn May 31 '09 at 23:43
Ctrl + Shift + M: changes a static method or static attribute reference of a class to a static import.
Before
import X;
...
X.callSomething();
After
import static X.callSomething;
...
callSomething();

- 22,896
- 10
- 72
- 102

- 23,534
- 11
- 81
- 97
-
Nice one! I've got to try this. Do you know if there's a shortcut for the other way around as well? – Jorn Jun 10 '10 at 16:53
Alt+Up or Alt+Down to move lines

- 22,896
- 10
- 72
- 102

- 14,656
- 11
- 42
- 52
-
Also moves multiple lines if selected, and fixes indentation on the fly. – Harold L Jul 30 '09 at 06:15
Nobody's mentioned the best one yet. Click on a class or method name and press Ctrl+T.
You get a quick type hierarchy. For a class name you see the entire class hierarchy. For a method name you get the hierarchy showing superclasses and subclasses, with implementations of that method distinguished from abstract mentions, or classes that don't mention the method.
This is huge when you are at an abstract method declaration and quickly want to see where it is implemented.

- 22,896
- 10
- 72
- 102

- 85,615
- 20
- 155
- 190
-
Ha, was going to add that one - so useful when dealing with a code base that uses interfaces for everything! – Darren Greaves Nov 19 '08 at 18:42
-
F3 has been my favorite, opens the definition for the selected item.
Ctrl+Shift+R has an interesting feature, you can use just the uppercase camel letters from a class when searching (such as typing CWAR will show a result for ClassWithAReallyLongName).
Alt+Shift+W > Package Explorer makes life easier when browsing large projects.

- 22,896
- 10
- 72
- 102

- 908
- 3
- 13
- 27
-
1That camel case trick also works when writing code. Type CWAR in the editor then hit CTRL-Space and it will expand to ClassWithAReallyLongName. I'm going to add this as a separate tip if it's not there already. – Darren Greaves Nov 19 '08 at 18:44
-
The Camel Case trick also works in the Ctrl+Shift+T dialog, and I find it *so* useful that I don't naviagte to classes any more if I know their names. It's also one of those tricks that makes your partner go "Woah! How did you do that?" when you're pairing. – banjollity Feb 27 '09 at 06:32
-
Just a moment ago I was wondering if there was a shortcut that could bring the package explorer up without having to click on the minimized icon. Thanx for this :-) – guyumu Mar 11 '09 at 08:41
-
Alternative for F3: Control + click on a class, function, or variable to go to its declaration. This also works for Javadoc @link tags; clickable elements get underlined when you hover your cursor over it. – cthulhu Dec 24 '10 at 12:30
A non-keyboard shortcut trick is to use commit sets in your Team->Synchronise view to organise your changes before committing.
Set a change set to be the default, and all changes you make on files will be put in that set, making it easy to see what you have changed while working on a specific defect/feature, and other changes you had while testing etc.

- 13,338
- 13
- 52
- 56
Eclipse let you set breakpoints based on where an Exception occurs.
You access the option via the "j!" alt text http://help.eclipse.org/stable/topic/org.eclipse.jdt.doc.user/images/org.eclipse.jdt.debug.ui/elcl16/exc_catch.png icon in the debugging window.
alt text http://blogs.bytecode.com.au/glen/2007/04/06/images/2007/AddExceptionWindow.png
The official help topic "Add Java Exception Breakpoint " has more on this.
- The Uncaught Exception option is to suspend execution when an exception of the same type as the breakpoint is thrown in an uncaught location.
- The Caught Exception option is to suspend execution when an exception of the same type as the breakpoint is thrown in a caught location.
- do not forget the Exception Breakpoint Suspend on Subclass of this Exception:
to suspend execution when subclasses of the exception type are encountered.
For example, if an exception breakpoint forRuntimeException
is configured to suspend on subclasses, it will also be triggered by aNullPointerException
.

- 1,262,500
- 529
- 4,410
- 5,250
CTRL+SPACE, for anything, anywhere.
Generate getters and setters.
Create Constructors using Fields
Extract Method...
Refactor->Rename
CTRL+O for the quick outline. CTRL+O+CTRL+O for the inherited outline.
F4 to display a type hierarchy
Open Call Hierarchy to display where a method is called from.
CTRL+SHIFT+T to open a Java Type
CTRL+SHIFT+R to open any resource.
ALT + left or right to go forward or backwards through edit places in your documents (easy navigation)
Override/Implement methods if you know you're going to do a lot of methods (otherwise, CTRL+SPACE is better for one at a time selection.
Refactor->Extract Interface
Refactor->Pull up
Refactor->Push down
CTRL+SHIFT+O for organize imports (when typing the general class name such as Map, pressing CTRL+SPACE and then selecting the appropriate class will import it directly for you).
CTRL+SHIFT+F for formatting (although Eclipse's built in formatter can be a little braindead for long lines of code)
EDIT: Oh yeah, some debugging:
F5: Step into (show me the details!)
F6: Step over (I believe you, on to the next part...)
F7: Step out (I thought I cared about this method, but it turns out I don't, get me out of here!)
F8: Resume (go until the next breakpoint is reached)
CTRL+SHIFT+I: inspect an expression. CTRL+SHIFT+I+CTRL+SHIFT+I: create a watch expression on the inspected expression.
Conditional breakpoints: Right click a breakpoint and you may set a condition that occurs which triggers its breaking the execution of the program (context assist, with Ctrl+Space, is available here!)
F11 - Debug last launched (application)
CTRL+F11 - Run last launched (application)

- 29,217
- 16
- 62
- 80
Ctrl+Alt+UP or Ctrl+Alt+DOWN to copy lines

- 22,896
- 10
- 72
- 102

- 14,656
- 11
- 42
- 52
-
14Unless it gets intercepted by your video driver, and you end up with an upside-down screen. – Adam Jaskiewicz Feb 27 '09 at 16:26
-
Ctrl+Alt+H on a method to get the call hierarchy for it. Fast way to see where it is called from.

- 22,896
- 10
- 72
- 102

- 2,126
- 1
- 26
- 34
Alt + Shift + R to refactor and rename.

- 22,896
- 10
- 72
- 102

- 6,080
- 2
- 33
- 39
-
1Alt+Shift+R is Refactor->Rename. There are several other refactoring shortcuts in Eclipse. – MetroidFan2002 Sep 16 '08 at 06:01
Not so Hidden but IMO the best Trick.
Assuming Default Settings (and you have'nt added new snippets)
Highlight (or select) a Text (String or Variable)...Press Ctrl+Space. Hit End+Enter. the "sysout" snippet is triggered which wraps the selection around as its parameter.
eg.
"hello world!"
becomes
System.out.println("hello world!");
I love it so much that i've implemented a similar snippet for Android's Toast and Log.i() HUGE Time saver during Manual Debugging....

- 33,375
- 8
- 89
- 89
-
-
Hm, when I hit End it just goes to selected string's end, not to the end of the suggestion list. – serg Jul 02 '10 at 17:14
-
Maybe you should press an additional "down" key before you hit end... :( – st0le Jul 03 '10 at 04:03
Ctrl+Shift+L will show you all the currently available keyboard shortcuts

- 22,896
- 10
- 72
- 102

- 13,338
- 13
- 52
- 56
-
4Then press it again to go to the keyboard shortcuts preferences page! – chickeninabiscuit Jun 11 '10 at 03:06
Here is my collection of the most useful keyboard shortcuts for Eclipse 3:
Eclipse 3 Favorite Keyboard Shortcuts.
by -=MaGGuS=-
Navigate:
• Ctrl + Shift + L – Shows useful keyboard shortcuts in popup window
• Ctrl + H – Search.
• Ctrl + K – Goes to next search match in a single file. Shift + Ctrl + K – goes to previous match.
• F3 - Goes to ‘declaration’ of something. Same as Ctrl + Click.
• Ctrl + Shift + G - Use this on a method name or variable. It will search for references in the code (all the code) to that item.
• Ctrl + O – Shows outline view of the current class or interface.
• Ctrl + T – Shows class hierarchy of the current class or interface. F4 – shows the same in separate tab.
• Ctrl + Shift + T - Open Type. Search for any type globally in the workspace.
• Ctrl + Shift + R – Open Resource. Search for any file inside workspace.
• Ctrl + J – Incremental search. Similar to the search in firefox. It shows you results as you type. Shift + Ctrl +J - Reverse incremental search.
• Ctrl + Q – Goes to the last edit location.
• Ctrl + Left|Right – Go Back/Forward in history.
• Ctrl + L – Go to line number.
• Ctrl + E – This will give you a list of all the source code windows that are currently open. You can arrow up or down on the items to go to a tab.
• Ctrl +PgUp|PgDown – Cycles through editor tabs.
• Ctrl + Shift + Up|Down - Bounces you up and down through the methods in the source code.
• Ctrl + F7 – Switches between panes (views).
• Ctrl + ,|. – Go to the previous/next error. Great in combination with Ctrl + 1.
• Ctrl + 1 on an error – Brings up suggestions for fixing the error. The suggestions can be clicked.
• Ctrl + F4 – Close one source window.
Edit:
• Ctrl + Space – Auto-completion.
• Ctrl + / – Toggle comment selected lines.
• Ctrl + Shift + /|\ – Block comment/uncomment selected lines.
• Ctrl + Shift + F – Quickly ‘formats’ your java code based on your preferences set up under Window –> Preferences.
• Ctrl + I – Correct indentations.
• Alt + Up|Down – move the highlighted code up/down one line. If nothing is selected, selects the current line.
• Ctrl + D – Delete row.
• Alt + Shift + Up|Down|Left|Right – select increasing semantic units.
• Ctrl + Shift + O – Organize Imports.
• Alt + Shift + S – Brings up “Source” menu.
o Shift + Alt + S, R – Generate getter/setter.
o Shift + Alt + S, O – Generate constructor using fields.
o Shift + Alt + S, C – Generate constructor from superclass.
• Alt + Shift + T – Brings up “Refactor” menu.
• Alt + Shift + J – Insert javadoc comment.
• F2 – Display javadoc popup for current item. Shift + F2 – Display javadoc in external browser.
Run/Debug:
• F11 / Ctrl + F11 – Execute/debug.
• Ctrl + Shift +B – Toggle breakpoint.
• When paused: F5 – Step into, F6 – Step over, F7 – Step out, F8 – Resume.
• Ctrl + F2 – Terminate.
EOF

- 10,605
- 8
- 32
- 42
Ctrl-Alt-h To open the Call hierarchy of the selected method.
Really useful on large codebases or unknown codebases

- 21
- 1
- 7
Ctrl+, and Ctrl+. move the text cursor to the next and previous error or warning (red or yellow squiggle) in the source. This gets really useful if you're dealing with a big block of dirty or broken code when you're in the depths of refactoring or pasting. Combined with Ctrl+1 for suggest fix you can quickly repair the code without having to move your hand to the mouse.
In fact, you barely have to lift your finger off Ctrl...

- 4,490
- 2
- 29
- 32
A hidden gem is the conditional breakpoint. Really useful for skipping over portions of loops, pausing if something is null or meets a certain value, etc... just right-click on the breakpoint, Breakpoint Properties
--> Enable Condition
. There's even code assist within the textbox!

- 1,303
- 3
- 13
- 19
ctrl + O is an popup outline view that lets you start typing to filter on a name
Ctrl + F3 works similarly, but it can open other types' outlines based on where your cursor is.
Turn on the Save Action to clean up your code and it will be automatically formatted and import optimized every time you save. To easily get to this option choose "Windows|Preferences" start type "Save Act" in the filter box and turn on the option.
In the new 3.4 release, turn on the "Breadcrumb trail" at the top of the editor window. There's a new toolbar button for this.
Save Actions rocks. There you can get your Imports organized (Ctrl+Shift+o) and formatting of code (CTRL + SHIFT + f). Besides from that i love ALt + Shift + R for refactoring.
My favorite things is the plugins though: They might cause you to use more time but most of the time they give quality (subjective I know)
- Code coveragde (ECLEMMA)
- Static analysis on source(PMD)
- Static analysis on byte code(FindBugs)
- CheckStyle
- SpringIDE.
Then you start to rock with the mandatory source control plugins and the maven 2 plugin.
Rock on!

- 7,042
- 7
- 44
- 67
Ctrl + Shift + P to find the matching brace. Really useful while working with long codes.

- 20,548
- 30
- 97
- 138
-
2Another trick is to double click just after one of the bracket, Eclipse will select all the text nested between the two brackets. – Romain Linsolas Mar 25 '09 at 13:03
You can CTRL-click on just about any type, field, method, or variable and eclipse will bring you to the declaration of that item:
ie:
- on a local variable - brings you to the declaration statement in the function
- on a member variable - brings you to the definition in a class file that the member is declared (or the parent class if it's not overridden in a child class
- on a class - brings you to the top of the class file for that class
You can also CTRL-hover over a type to bring up the option to find an implementation. This is useful if you are using an interface and want to see what classes implement that interface. It also works to see what super-classes and subclasses might implement/override a certain function.

- 571
- 3
- 10
-
Or click, and then press F3. This is less magical, however, as the text doesn't turn into a "link". And I didn't know about the ctrl-hover for interfaces. Nice! – Tyler Jul 02 '10 at 16:51
If you want to put a System.out.println("anything"); to your code you can simply do as follows: Only write ", then mark the "" and press Crtl-Space Up-Arrow and enter (you should land on "sysout").
Voila, there it is :)
-
Writing "syso" and ctrl-space'ing will do the same thing :) – Espen Herseth Halvorsen Nov 02 '08 at 19:30
-
From my logic, typing syso will not do the same thing. The above point is for embedding the selected string in the sysout statement. – guyumu Mar 11 '09 at 08:51
How about:
Ctrl-PgUp and Ctrl-PgDn to navigate through the open files in the editor (including the overflow section if you Ctrl-PgDn all the way to the right).

- 5,177
- 5
- 24
- 24
alt+shift+z - to active the "surround with" sub menu. Handy when have to surround with a try catch block.

- 4,697
- 5
- 35
- 37
ctrl-alt-up/down to copy a line up (or down). That followed by alt-up/down is often much quicker than a copy-paste

- 2,256
- 1
- 26
- 42
Don't know a keyboard shortcut to it, but select a local variable in a method, and then right click. Under refactor is "convert local variable to field". Very useful on occasions. Just wish there was a shortcut for it!

- 2,256
- 1
- 26
- 42
-
1On my MacBook the keyboard shortcut is command-alt-F. Of course these key mappings are configurable under preferences->keys (In Eclipse 3.4) – Scott Bale Oct 25 '08 at 20:33
-
2You can do that by calling the quick-refactoring menu, CTRL-1 with the cursor on the local var. – Urs Reupke Jan 09 '09 at 21:44
Ctrl+f then tick the "Regular expressions" checkbox. From that, you can search with regular expressions, but even more powerfully, you can include group matches in your replacement string ($1, $2, etc, or $0 for the whole match).

- 44,224
- 30
- 113
- 140
One combination to rules them all.
CTL+SHFT+L
Get the list of all these "hidden" features.

- 1,643
- 1
- 18
- 29
I am sorry if this is a duplicate, but I don't think I have seen this one mentioned here and I scanned over all of the posts:
Word completion:
Alt + /
is a really nice alternative to Ctrl+Space. It doesn't quite replace Ctrl+Space, but is much faster. And don't be afraid to press it multiple times, it will keep cycling over possible options.

- 20,434
- 21
- 120
- 152
CTRL-MouseClick (left) as an alternative for F3 to go to declaration.
ctrl+d to delete the current line
alt+up/down to move the current line or block of selected text up or down
ctrl+alt+up/down to copy/duplication the current line or block of selected text up or down
ctrl+alt+c SVN commit (with subversive)
ctrl+alt+u SVN update (with subversive)

- 30,978
- 7
- 65
- 89
I recently mapped alt-enter to the same command as ctrl-1. It's just a bit easier to get to.
I also use alt+shift+x &t a bunch, but I'm not a fan of how the integrated test runner works.

- 2,003
- 1
- 18
- 21
If you are using the F3 key to navigate to the source code of a method, you could often waste your time to switch to the the Interface instead of going directly to the implementation class (there is often only one, for DAO, Service,... for example)
Using Ctrl+Mouse pointer to one method of the code, you will be able to choose between directly going to the Directly go to the Implementation (the class) or the Declaration (the interface)
More info about this tip here:
http://www.ibm.com/developerworks/opensource/library/os-eclipse-galnav/index.html
This is only available in Galileo and you can use Ctrl + T as well for the same.
Quick Assist: Ctrl + 2, followed by F (assign to field), L(assign to local variable) and R (rename in file)
Last edit location: Ctrl+Q
Check out this article: http://dmy999.com/article/29/using-eclipse-efficiently

- 101
- 3
ALT+Shift+X + T
This will run your current file as a unit test.

- 6,229
- 8
- 28
- 30
-
CTRL+ALT+Shift+D + T : debug this unit test. And for these 2 commands, if the cursor is on a test method name, it'll only run that test case. – Harold L Jul 30 '09 at 06:19
Ctrl-1 to convert if to conditional expression and back, split an assignment or join it back or do other such small manipulations. There is a list of these in the help.

- 7,339
- 3
- 31
- 36
Double click next to an opening bracket will highlight all the code till the closing bracket, and vice versa.

- 1,915
- 1
- 23
- 39
Ctrl-F6 to cycle focus through open Editor windows (with Ctrl-Shift-F6 to cycle backwards)
Ctrl-F7 to cycle focus through Eclipse views
Ctrl-F8 to cycle Eclipse perspectives

- 24,333
- 24
- 88
- 134
NOT so hidden feature ,but very less people use it and do not explore it Template Key board shortcut
and Alex has explained about Member sort

- 3,261
- 9
- 39
- 66
Depending on what time saver means to you...
Adding TODO and FIXME in a comment automatically adds a task to the task list in Eclipse. So if there is code you want to come back to, say you were debugging and need to do some research, you can do...
FIXME means it is urgent, which puts a red ! in the task window
TODO is normal urgency
//FIXME: This accidentally deletes user accounts
user.account().delete();
//TODO: Add some validation before assigning everyone as admin
user.setPrivilege("Admin");
And then there are the setters/getters automatically being built. This is great if you are creating a bean or something. Say you have declared a class such as:
public class SomeBean {
private static int FIRST_VALUE = 0;
private static int SECOND_VALUE = 1;
...
private static int THOUSANDTH_VALUE = 1000;
}
You can create all the variables, then right-click in the editor, go to Source and then pick Generate Setters & Getters. This will automatically create them for you.

- 14,409
- 18
- 71
- 103
Ctrl+Shift+Enter to move the current line down by one and start typing above it.
Ctrl+Shift+X to capitalize the current selection, Ctrl-Shift-Y to change it lowercase.
Ctrl+. Autocompletes the current word. This works for variables as well as strings (which is a huge timesaver for array keys, for example)

- 1,004
- 2
- 11
- 16
Shift-F2 goes to the Javadoc for any method.
Use it a LOT. For libraries you need to configure the location , but for standard classes they are predefined by Eclipse

- 73,784
- 33
- 194
- 347
When debugging I find the "Display" view really useful. It lets you type code (using auto complete) and lets you run/display the outcome of whatever you write.
Give it a try!

- 28,387
- 9
- 92
- 148

- 2,321
- 1
- 19
- 24
Of course if you can't find the binding you are looking for, or don't like the current binding Window -> Preferences -> General -> Keys will allow you to change, add & delete the mappings of your key combo's.

- 17,443
- 36
- 114
- 172
In
Windows/Preferences/General/Keys
define
Alt + C
for SVN Commit
Alt + U
for SVN Update
Shift + Ctrl + N
for New Class Dialog.

- 59,493
- 71
- 188
- 276
The eclipse help contains a lot of useful resources. Just search for "tips & tricks". In particular the "Tips and Tricks (JDT)" i found to be very useful.

- 4,834
- 5
- 44
- 65
CTRL + b: to build the project under c++
CTRL + SHIFT + f: to format your code (c++)

- 773
- 1
- 9
- 15
-
CTRL + b is also useful in Java: I add ant builders to my projects, and CTRL + b runs my ant scripts. So normally Eclipse just auto-builds the code, but if I want something more to happen (e.g. javadoc or deployment to a test server), CTRL + b. – Harold L Jul 30 '09 at 06:18
If you build your project with Ant you can assign a shortcut to "Runs the last launched external Tool" like Ctrl+Enter and it will repeat your last build. It is much easier than standard Alt+Shift+X,Q also it helps with a bug in the latest Eclipse that cannot find an ant build file in the project.

- 109,619
- 77
- 317
- 330
Of course all these shortcuts are available in the menus but who has time for that when you're in the "zone".
I like the code hot swapping.

- 443
- 1
- 4
- 7
I'm really biased and this is blatant advertising...
Still, I think my new Eclipse plugin, nWire, is the best time saver you can get for Eclipse. I developed it after years of working with Eclipse, I just came to the conclusion that I need one tool to show me all the associations of my code instead of learning different tools and views.
Check out the demo on my web site.

- 9,765
- 4
- 38
- 49
Enabling 'Ignore white space' in the Compare/Patch settings is a real time saver!
I'm surprised no one mentioned the Emacs keybinding setting available in Eclipse. This is one of my favorite little features; it allows me to transition from Emacs to Eclipse with little adjustment in my navigation preferences.
Windows->Preferences->General->Keys->Scheme.

- 5,774
- 4
- 31
- 49