Java, Eclipse and Web programming Tutorials
Follow me on twitter About Lars Vogel

Eclipse Shortcuts

Lars Vogel

Version 0.3

29.07.2009

Revision History
Revision 0.121.06.2009Lars Vogel
Created
Revision 0.222.06.2009Lars Vogel
Extended and reworked
Revision 0.326.07.2009Lars Vogel
Quick Access dialog
Revision 0.429.07.2009Lars Vogel
Shortcut for getting and setter

Eclipse Shortcuts

This article gives a list of my preferred Eclipse shortcuts / keybindings.

Use shortcuts for common tasks can dramatically increase your programming productivity. I this article list in this article my preferred shortcuts.

This article is based on Eclipse 3.5 (Galileo).


Table of Contents

1. Overview
2. Navigation
3. Run
4. Editing
5. Other Shortcuts
5.1. Quick Access dialog
5.2. Coding
5.3. Refactoring
5.4. Debugging
6. Thank you
7. Questions and Discussion
8. Links and Literature
8.1. Source Code
8.2. Other Resources

1. Overview

Please see Eclipse IDE for Java for an introduction to Eclipse.

Eclipse supports a lots of actions via keyboard shortcuts. The following lists the most common used shortcuts.

2. Navigation

Table 1.  Navigation

ShortcutDescription
CTRL + SHIFT + ROpen / Search for resources, e.g. files
CTRL + SHIFT + TOpen / Search for Types
CTRL + TUsed on a method in an interface shows all implementing methods
STRG + O In place outline view (displayed in editor), allows to search directly for elements in the selected file via type-ahead
ALT + LEFT ARROW KEY or ALT + RIGHT ARROW KEY Go to prev/ next editor position in history
CTRL + Mouse-click on a variable Go to declaration of this variable
CTRL + SHIFT + P Go to matching bracket

Table 2. Search

ShortcutDescription
Ctrl + .Go to previous / next problem
F3 on a variable Goto Declaration of this variable
F4 on a variable Show type hierarchy
Strg + J , Strg +kIncremental search, find next
STRG + SHIFT + GSearch for reference in the workspace

3. Run

Table 3. 

ShortcutDescription
Ctrl F11Run last launched
Alt + Shift + X - JRun as Java application

4. Editing

Table 4.  Handling the editor

ShortcutDescription
CTRL + 1Quickfix, dependend on cursor position
F12Focuses the editor (especially helpful if you working with Fast Views
Ctrl + M Maximize Java editor
CTRL + Shift + FFormat source code
CTRL + Shift + O Organize the imports / Will import the missing imports.
CTRL + Shift + S Source generation related operations such as creating getter/setter
CTRL + QLast edited position

Table 5.  Arrow Keys

ShortcutDescription
CTRL + LeftMove one element to the left
CTRL + RightMove one element to the right
CTRL + ALT + DownCopy line
ALT + Up / DownMove line up / down
ALT + SHIFT Up / DownSelect the previous / next syntactical element
ALT + SHIFT Up / Down / Left / RightExtending / Reducing the selection of the previous / next syntactical element
CTRL + Up / Down Scroll up / down a line in the editor

Table 6. Delete

ShortcutDescription
Ctrl + DDeletes line
STRG + SHIFT + DELEDelete until end of line
Ctrl + DELEDelete next element
Ctrl + BACKSPACEDelete previous element

5. Other Shortcuts

5.1.  Quick Access dialog

CTRL+3 opens the Quick Access dialog. In the quick access dialog, you can type the name of any command, preference, wizard, view, perspective, etc.

5.2. Coding

Table 7. 

ShortcutDescription
Shift + F2 Call the Javadoc for the selected type / class / method
Alt+Shift + N + LetterType shortcut for the command, e.g. njc to create a new Java class or npip to create a new Plugin project.
Alt + Shift + Z Surround block with try and catch

5.3. Refactoring

Table 8. Refactoring

ShortcutDescription
ALT- SHIFT +R Rename
ALT- SHIFT +RQuick refactoring menu

5.4. Debugging

Table 9. Debugging

ShortcutDescription
F11Debug last run
Cntl + Shift + BToggle breakpoint
F5 Single Step (Down)
F6 Single Step (Jump)
F7Up

6. Thank you

Thank you for practicing with this tutorial.

Please note that I maintain this website in my private time. If you like the information I'm providing please help me by donating.

7. Questions and Discussion

For questions and discussion around this article please use the www.vogella.de Google Group. Also if you note an error in this article please post the error and if possible the correction to the Group.

I believe the following is a very good guideline for asking questions in general and also for the Google group How To Ask Questions The Smart Way.

>

8. Links and Literature

8.1. Source Code

http://www.vogella.de/code/codeeclipse.html Source Code of Examples