When I first started working at Intelliware I was amazed at how efficient the developers were while working in Eclipse. Most of this efficiency and speed came from a deep knowledge of Eclipse’s keyboard shortcuts.
Here is my list of Eclipse keyboard shortcuts that every developer should know.
- Ctrl-Shift-L: Show list of shortcuts
- Ctrl-K: Find next
- Ctrl-Shift-R: Open a file in your workspace. It supports CamelCase shorthand too, so “SBFil” will find “SomeBigFile.java” and “SBFile.java”
- Ctrl-Shift-G: Find references for a class or method. Want to find who calls MyClass.getName()? Put your cursor on the getName() definition and hit Ctrl-Shift-G
- F3: Drill into a method. This will jump from the code that calls the method into the method definition. Similar to holding Ctrl and clicking on the method call.
- Ctrl-T: Open implementors of an interface. Very useful when using F3 to follow the flow of method calls.
- Ctrl-O: Open a list of method declarations in the current class. Allows you to jump directly to the method using the arrow keys and enter. Bonus points: typing Ctrl-O again while the list is showing will also list method declarations from all superclasses
- Ctrl-E: Shows a list that allows you to switch between open files
- Alt-Shift-W: Locates the current file in the Navigation or Package Explorer tree.
- Ctrl-L: Go to line number. You might want to show line numbers by default by changing the preference General>Editors>Text Editors
- Ctrl-H: Find a string in all files. You can customize this to only show the File search by clicking the Customize button and unchecking the other options
- Ctrl-Shift-O: Organize import statements. This also removes any unused imports.
- Ctrl-Shift-F: Reformat the file
You should also familiarize yourself with the following debugging shortcuts
- F5: Step into
- F6: Step over
- F7: Step back out
- F8: Resume (i.e. continue to next breakpoint)
- Ctrl-Shift-I: Show current value of variable
- Ctrl-R: Run to current line