0% found this document useful (0 votes)
87 views3 pages

Eclipse Shortcuts

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

ECLIPSE SHORTCUTS

1. Quick Access
Shortcut Description Ctrl + 3 Perform all available actions in Eclipse. This shortcut puts the focus into the Quick Access search box which allows you to execute any Eclipse command.

2. Navigation
2.1. Globally available navigation shortcuts

Table 1. Navigation
Shortcut Ctrl + Shift + T Ctrl + E Ctrl + F8 Description Search dialog for Java Types Search dialog to select an editor from the currently open editors Shortcut for switching perspectives Ctrl + Shift + R Search dialog for resources, e.g. text files

2.2. Navigation shortcuts in the editor

Table 2. Search from an editor


Shortcut F3 Ctrl + . Ctrl + , F4 on a variable Ctrl + J Ctrl + K Ctrl + Shift + G Ctrl + Shift + P Description Opens editor to selected element (type) or navigate to the declaration of the selected variable Go to the next problem / error Go to the previous problem / error Show type hierarchy Incremental search without popup dialog, just starting typing to search. Press Ctrl + J to find the next match Searches the selected text or if nothing is selected the last search from the Find dialog. In the Java editor, s\earch for references in the workspace Select the matching bracket. Cursor needs to be placed before or after a bracket.

Table 3. Navigation between editors


Shortcut Alt + Alt + Ctrl + Q Ctrl + PageUp Description Go to previous opened editor. Cursor is placed where it was before you opened the next editor Similar Alt + but opens the next editor Go to editor and the position in this editor where the last edit was done Switch to previous opened editor

Ctrl + PageDown Switch to next opened editor

3. Start Java programs


Table 4. Running programs
Shortcut Ctrl + F11 Description Run last launched

Alt + Shift + X, J Run current selected class as Java application

5. Editing
Table 5. Handling the editor
Shortcut Ctrl + 1 Ctrl + Space Ctrl + T Ctrl + O Ctrl + M Ctrl + Shift + F Ctrl + I Ctrl + F Ctrl + Alt + Z Description Quickfix; result depending on cursor position Content assist/ code completion Show the inheritance tree of the current Java class or method. Show all methods of the current class, press Ctrl + O again to show the inherited methods. Maximize active editor or view Format source code Correct indentation, e.g. format tabs/whitespaces in code Opens the find dialog Wrap the select block of code into a block, e.g. try/catch.

Ctrl + Shift + O Organize the imports; adds missing import statements and removes unused ones

Table 6. Cursor navigation and text selection


Shortcut Ctrl + or Ctrl + Ctrl + or Ctrl + Shift + P Shift + Cursor movement Alt + Shift / Description Move one text element in the editor to the left or right Scroll up / down a line in the editor Go to the matching bracket Select text from the starting position of the cursor Select the previous / next syntactical element

Alt + Shift / / / Extending / reducing the selection of the previous / next syntactical element

Table 7. Copy and move lines


Shortcut Ctrl + Alt + Cusor Up Alt + Up Alt + Down Description Copy current line above the line in which the cursor is placed Move line one line up Move line one line down Ctrl + Alt + Cusor Down Copy current line below the line in which the cursor is placed

Table 8. Delete
Shortcut Ctrl + D Ctrl + Shift + DEL Ctrl + DEL Description Deletes line Delete until end of line Delete next element

Ctrl + BACKSPACE Delete previous element

Table 9. Create new lines


Shortcut Shift + Enter Description Adds a blank line below the current line and moves the cursor to the new line. The difference between a regular enter is that the currently line is unchanged, independently of the position of the cursor.

Ctrl+Shift+Enter Same as Shift + Enter but above

Table 10. Variable assignment


Shortcut Ctrl + 2, L Description Assign statement to new local variable

Ctrl + 2, F Assign statement to new field

6. Coding
Table 11. Coding
Shortcut Shift + F2 Alt+Shift + N Description Show the Javadoc for the selected type / class / method Shortcut for the menu to create new objects

Alt + Shift + Z Surround block with try and catch

7. Refactoring
Table 12. Refactoring
Shortcut Ctrl + 2, R Alt + Shift + T Description Rename locally (in file), faster than Alt + Shift + R Opens the context-sensitive refactoring menu, e.g. displays Alt + Shift + R Rename

8. Minimum
Table 13. Must known shortcuts
Shortcut Ctrl + S Ctrl + 1 Ctrl + Space Ctrl + Q Ctrl+ D Ctrl + 2, L or F Ctrl + Shift + T Ctrl + O Ctrl + F11 Description Saves current editor Quickfix; shows potential fixes for warnings, errors or shows possible actions Content assist/ code completion Goes to the last edited position Deletes current line in the editor Assign statement to new local variable or field Open Type Dialog Shows quick outline of a class Run last launched application

Ctrl + Shift + O Adjusts the imports statements in the current Java source file

You might also like