vogella.de

Follow me on twitter
About Lars Vogel
Flattr this

Eclipse Shortcuts

Lars Vogel

Version 0.7

21.07.2010

Revision History
Revision 0.121.06.2009Lars Vogel
Created
Revision 0.2 - 0.522.06.2009 - 26.03.2010Lars Vogel
bug fixes and enhancements
Revision 0.612.07.2010Lars Vogel
Update to Eclipse 3.6 (Helios)
Revision 0.721.07.2010Lars Vogel
bug fixes and enhancements

Eclipse Shortcuts

This article gives a list of my preferred Eclipse shortcuts / keybindings. It is based on Eclipse 3.6 (Helios).


Table of Contents

1. Overview
2. Navigation
3. Run
4. Editing
5. Programming
5.1. Coding
5.2. Refactoring
5.3. Debugging
6. Thank you
7. Questions and Discussion
8. Links and Literature
8.1. Source Code
8.2. vogella Resources

1. Overview

Eclipse supports a lots of actions via keyboard shortcuts. The following lists the most common used shortcuts. Please see Eclipse IDE for Java for an introduction to Eclipse.

All commands can be accessed via the shortcut "CTRL+3". This shortcut opens the Quick Access dialog. In the quick access dialog, you can type the name of any command, preference, wizard, view, perspective, etc.

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 or class shows the whole inheritance tree, for example all methods which implement an interface.
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-PageUp/PageDown Previous/next tab
F3 Go to declaration of this variable
CTRL + SHIFT + P Go to matching bracket

Table 2. Search

ShortcutDescription
Ctrl + .Go to next problem
Ctrl + ,Go to previous 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 + Up/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

Table 7. Variable assignment

ShortcutDescription
Ctrl + 2 + LAssign statement to new local variable
Ctrl + 2 + FAssign statement to new field

5. Programming

5.1. Coding

Table 8. 

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.2. Refactoring

Table 9. Refactoring

ShortcutDescription
ALT- SHIFT +R Rename
ALT- SHIFT +RQuick refactoring menu
ALT- SHIFT + TOpens the quick refactoring menu

5.3. Debugging

Table 10. Debugging

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

6. Thank you

Thank you for practicing with this tutorial.

I maintain this tutorial in my private time. If you like the information please help me by using flattr or donating or by recommending this tutorial to other people.

Flattr this

7. Questions and Discussion

Before posting questions, please see the vogella FAQ . If you have questions or find an error in this article please use the www.vogella.de Google Group . I have created a short list how to create good questions which might also help you. .

8. Links and Literature

8.1. Source Code

Source Code of Examples