Eclipse Shortcuts - Tutorial
Lars Vogel (c) 2009, 2017 vogella GmbHVersion 2.8,25.04.2017
Table of Contents
- 1. Shortcuts
- 2. Quick Access
- 3. Navigation and text selection
- 4. Start Java programs
- 5. Editing in the Java editor
- 6. Coding
- 7. Refactoring
- 8. Minimum
- 9. About this website
- 10. Links and Literature
- Appendix A: Copyright and License
Eclipse Shortcuts. This article lists helpful Eclipse shortcuts.
1.1. Using shortcuts in Eclipse
Using shortcuts make a developer more productive. Eclipse provides keyboard shortcuts for the most common actions. Using shortcuts is usually preferable as you can perform actions much faster.
Eclipse supports of course the typical shortcuts, e.g.?Ctrl+S?for saving,?Ctrl+C?for copying the selected text or file and?Ctrl+V?for pasting the element currently in the clipboard.
This description uses the shortcuts based on Windows and Linux. Mac OS uses the?Cmd?key frequently instead of the?Ctrl?key.
The?Ctrl+3?shortcut allows you to perform all available actions in Eclipse. This shortcut puts the focus into the?Quick Access?(quick access) search box which allows you to execute any Eclipse command. For example you can open aPreference, a?Wizard, a view and a?Preference?page.
You can also use?QuickAccess?to search for an opened editor by typing in the name of the resource which the editor shows.
The following screenshot shows how you the available commands in quick access for the "New Java" search term.
Shortcut |
Description |
Ctrl+Shift+R |
Search dialog for resources, e.g., text files |
Ctrl+Shift+T |
Search dialog for Java Types |
Ctrl+F8 |
Shortcut for switching perspectives |
Table 1. Navigation
Shortcut |
Description |
Ctrl+E |
Search dialog to select an editor from the currently open editors |
Alt+← |
Go to previous opened editor. Cursor is placed where it was before you opened the next editor |
Alt+→ |
Similar Alt + ← but opens the next editor |
Ctrl+Q |
Go to editor and the position in this editor where the last edit was done |
Ctrl+PageUp |
Switch to previous opened editor |
Ctrl+PageDown |
Switch to next opened editor |
Table 2. Navigation between editors
Shortcut |
Description |
Ctrl+F7 |
Shortcut for switching views. Choose the view to switch to with your mouse or cycle through the entries with repeating the keystroke |
Shift+Alt+Q |
Open menu for switch view keybindings |
Shift+Alt+Q+P |
Show package explorer |
Shift+Alt+Q+C |
Show console |
Table 3. Navigation between views
Shortcut |
Description |
Ctrl+F11 |
Run last launched |
F11 |
Run last launched in debug mode |
Ctrl+Alt+B |
Skip all breakpoints. Let‘s you use debug mode for code reloading |
Alt+Shift+X+J |
Run current selected class as Java application |
Alt+Shift+X+T |
Run JUnit test |
Alt+Shift+X+P |
Run JUnit Plug-in test |
Table 4. Running programs
Shortcut |
Description |
Shift+Alt+↑ |
Selects enclosing elements.,result depending on cursor position |
Table 5. Handling the editor
Shortcut |
Description |
Ctrl+1 |
Quickfix; result depending on cursor position |
Ctrl+Space |
Content assist/ code completion |
Ctrl+T |
Show the inheritance tree of the current Java class or method. |
Ctrl+O |
Show all methods of the current class, press Ctrl + O again to show the inherited methods. |
Ctrl+M |
Maximize active editor or view |
Ctrl+Shift+F |
Format source code |
Ctrl+I |
Correct indentation, e.g., format tabs/whitespaces in code |
Ctrl+F |
Opens the find dialog |
Shift+Enter |
Adds a link break at the end of the line |
Ctrl+Shift+O |
Organize the imports; adds missing import statements and removes unused ones |
Alt+Shift+Z |
Wrap the select block of code into a block, e.g. try/catch. |
Table 6. Handling the editor
Shortcut |
Description |
Ctrl+←?or?Ctrl+→ |
Move one text element in the editor to the left or right |
Ctrl+↑?or?Ctrl+↓ |
Scroll up / down a line in the editor |
Ctrl+Shift+P |
Go to the matching bracket |
Shift+Cursor movement |
Select text from the starting position of the cursor |
Alt+Shift ↑ / ↓ |
Select the previous / next syntactical element |
Alt+Shift ↑ / ↓ / ← / → |
Extending / reducing the selection of the previous / next syntactical element |
Table 7. Cursor navigation and text selection
Shortcut |
Description |
Ctrl+Alt+↓ |
Copy current line below the line in which the cursor is placed |
Ctrl+Alt+↑ |
Copy current line above the line in which the cursor is placed |
Alt+Up |
Move line one line up |
Alt+Down |
Move line one line down |
Table 8. Copy and move lines
Shortcut |
Description |
Ctrl+D |
Deletes line |
Ctrl+Shift+DEL |
Delete until end of line |
Ctrl+DEL |
Delete next element |
Ctrl+BACKSPACE |
Delete previous element |
Table 9. Delete
Shortcut |
Description |
Shift+Enter |
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. Create new lines
Shortcut |
Description |
Ctrl+2+L |
Assign statement to new local variable |
Ctrl+2+F |
Assign statement to new field |
Table 11. Variable assignment
Shortcut |
Description |
Shift+F2 |
Show the Javadoc for the selected type / class / method |
Alt+Shift+N |
Shortcut for the menu to create new objects |
Alt+Shift+Z |
Surround block with try and catch |
Table 12. Coding
Shortcut |
Description |
Alt+Shift+R |
Rename |
Ctrl+2+R |
Rename locally (in file), faster than Alt + Shift + R |
Alt+Shift+T |
Opens the context-sensitive refactoring menu, e.g., displays |
Table 13. Refactoring
The following shortcuts are the absolute minimum a developer should be familiar with to work efficient in Eclipse.
Shortcut |
Description |
Ctrl+S |
Saves current editor |
Ctrl+1 |
Quickfix; shows potential fixes for warnings, errors or shows possible actions |
Ctrl+Space |
Content assist/ code completion |
Ctrl+Q |
Goes to the last edited position |
Ctrl+D |
Deletes current line in the editor |
Ctrl+Shift+O |
Adjusts the imports statements in the current Java source file |
Ctrl+2+L or F |
Assign statement to new local variable or field |
Ctrl+Shift+T |
Open Type Dialog |
Ctrl+O |
Shows quick outline of a class |
Ctrl+F11 |
Run last launched application |
Shift+F10 |
Opens context menu. Keyboard equivalent to Mouse2 |
Ctrl+F10 |
Opens view menu for current view. |
Table 14. Must known shortcuts
Nothing listed.
10.1. vogella GmbH training and consulting support
TRAINING |
SERVICE & SUPPORT |
The vogella company provides comprehensive?training and education services?from experts in the areas of Eclipse RCP, Android, Git, Java, Gradle and Spring. We offer both public and inhouse training. Whichever course you decide to take, you are guaranteed to experience what many before you refer to as?"The best IT class I have ever attended". |
The vogella company offers?expert consulting?services, development support and coaching. Our customers range from Fortune 100 corporations to individual developers. |
Appendix A: Copyright and License
Copyright ? 2012-2017 vogella GmbH. Free use of the software examples is granted under the terms of the EPL License. This tutorial is published under the?Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Germany?license.
See?Licence.
?
?
来自 <http://www.vogella.com/tutorials/EclipseShortcuts/article.html#coding>
103 Shortcuts for Eclipse Helios (Windows)??[edit]
Related:?Eclipse Index,?IDE?Shortcuts,?Windows?Shortcuts
Export as:?PDF,?Spreadsheet,?Printer-friendly
Table of Contents:
- Manage Files and Projects
- Editor Window
- Navigate in Editor
- Select Text
- Edit Text
- Search and Replace
- Indentions and Comments
- Editing Source Code
- Code Information
- Refactoring
- Run and Debug
- The Rest
- Team (SVN Subversive)
?Hide all??
?Show all
1. Manage Files and Projects |
?? |
Ctrl+N |
Create?new project using the Wizard |
Ctrl+Alt+N |
Create?new project, file, class, etc. |
Alt+F, then?. |
Open project, file, etc. |
Ctrl+Shift+R |
Open?Resource (file, folder or project) |
Alt+Enter |
Show and access file properties |
Ctrl+S |
Save current file |
Ctrl+Shift+S |
Save all files |
Ctrl+W |
Close current file |
Ctrl+Shift+W |
Close all files |
F5 |
Refresh content of selected element with local file system |
▲ up
2. Editor Window |
?? |
Focus/ cursor must be in Editor Window for these to work. |
?? |
F12 |
Jump to Editor Window |
Ctrl+Page Down/Ctrl+Page Up |
Switch to next editor / switch to previous editor |
Ctrl+M |
Maximize or un-maximize current Editor Window (also works for other Windows) |
Ctrl+E |
Show list of open Editors. Use?arrow keys?and?enter?to switch |
Ctrl+F6/Ctrl+Shift+F6 |
Show list of open Editors. Similar to?ctrl+e?but switches immediately upon release of?ctrl |
Alt+Arrow Left/Alt+Arrow Right |
Go to previous / go to next Editor Window |
Alt+- |
Open Editor Window Option menu |
Ctrl+F10 |
Show view menu (features available on left vertical bar: breakpoints, bookmarks, line numbers, …) |
Ctrl+F10, then?n |
Show or hide line?numbers |
Ctrl+Shift+Q |
Show or hide the diff column on the left (indicates changes since last save) |
Ctrl+Shift++/- |
Zoom text in/ out |
▲ up
3. Navigate in Editor |
?? |
Home/End |
Jump to beginning / jump to end of indention. Press?home?twice to jump to beginning of line |
Ctrl+Home/End |
Jump to beginning / jump to end of source |
Ctrl+Arrow Right/Arrow Left |
Jump one word to the left / one word to the right |
Ctrl+Shift+Arrow Down/Arrow Up |
Jump to previous / jump to next method |
Ctrl+L |
Jump to?Line Number. To hide/show line numbers, press?ctrl+F10?and select ‘Show Line Numbers‘ |
Ctrl+Q |
Jump to last location edited |
Ctrl+./Ctrl+, |
Jump to next / jump to previous compiler syntax warning or error |
Ctrl+Shift+P |
With a bracket selected: jump to the matching closing or opening bracket |
Ctrl+[+]/Ctrl+-?on numeric keyboard |
Collapse / Expand current method or class |
Ctrl+[/]/Ctrl+*?on numeric keyboard |
Collapse / Expand all methods or classes |
Ctrl+Arrow Down/Ctrl+Arrow Up |
Scroll Editor without changing cursor position |
Alt+Page Up/Alt+Page Down |
Next Sub-Tab / Previous Sub-Tab |
▲ up
4. Select Text |
?? |
Shift+Arrow Right/Arrow Left |
Expand selection by one character to the left / to the right |
Ctrl+Shift+Arrow Right/Arrow Left |
Expand selection to next / previous word |
Shift+Arrow Down/Arrow Up |
Expand selection by one line down / one line up |
Shift+End/Home |
Expand selection to end / to beginning of line |
Ctrl+A |
Select?all |
Alt+Shift+Arrow Up |
Expand selection to current element (e.g. current one-line expression or content within brackets) |
Alt+Shift+Arrow Left/Arrow Right |
Expand selection to next / previous element |
Alt+Shift+Arrow Down |
Reduce previously expanded selection by one step |
▲ up
5. Edit Text |
?? |
Ctrl+C/Ctrl+X/Ctrl+V |
Cut, copy and paste |
Ctrl+Z |
Undo last action |
Ctrl+Y |
Redo last (undone) action |
Ctrl+D |
Delete Line |
Alt+Arrow Up/Arrow Down |
Move current line or selection up or down |
Ctrl+Alt+Arrow Up/Ctrl+Alt+Arrow Down/ |
Duplicate current line or selection up or down |
Ctrl+Delete |
Delete next word |
Ctrl+Backspace |
Delete previous word |
Shift+Enter |
Enter line below current line |
Shift+Ctrl+Enter |
Enter line above current line |
Insert |
Switch between insert and overwrite mode |
Shift+Ctrl+Y |
Change selection to all lower case |
Shift+Ctrl+X |
Change selection to all upper case |
▲ up
6. Search and Replace |
?? |
Ctrl+F |
Open?find and replace dialog |
Ctrl+K/Ctrl+Shift+K |
Find previous / find next occurrence of search term (close find window first) |
Ctrl+H |
Search Workspace (Java Search, Task Search, and File Search) |
Ctrl+J/Ctrl+Shift+J |
Incremental search forward / backwards. Type search term after pressing?ctrl+j, there is now search window |
Ctrl+Shift+O |
Open a resource search dialog to find any class |
▲ up
7. Indentions and Comments |
?? |
Tab/Shift+Tab |
Increase / decrease indent of selected text |
Ctrl+I |
Correct?indention of selected text or of current line |
Ctrl+Shift+F |
Autoformat all code in Editor using code formatter |
Ctrl+/ |
Comment / uncomment line or selection ( adds ‘//‘ ) |
Ctrl+Shift+/ |
Add Block Comment around selection ( adds ‘/... */‘ ) |
Ctrl+Shift+\ |
Remove Block Comment |
Alt+Shift+J |
Add Element Comment ( adds ‘/** ... */‘) |
▲ up
8. Editing Source Code |
?? |
Ctrl+Space |
Opens Content Assist (e.g. show available methods or field names) |
Ctrl+1 |
Open Quick Fix and Quick Assist |
Alt+/ |
Propose word completion (after typing at least one letter). Repeatedly press?alt+/?until reaching correct name |
Ctrl+Shift+Insert |
Deactivate or activate Smart Insert Mode (automatic indention, automatic brackets, etc.) |
▲ up
9. Code Information |
?? |
Ctrl+O |
Show code?outline / structure |
F2 |
Open class, method, or variable information (tooltip text) |
F3 |
Open Declaration: Jump to Declaration of selected class, method, or parameter |
F4 |
Open Type Hierarchy window for selected item |
Ctrl+T |
Show / open Quick?Type Hierarchy for selected item |
Ctrl+Shift+T |
Open Type in Hierarchy |
Ctrl+Alt+H |
Open Call?Hierarchy |
Ctrl+Shift+U |
Find occurrences of expression in current file |
Ctrl+move over method |
Open Declaration or Implementation |
▲ up
10. Refactoring |
?? |
Alt+Shift+R |
Rename selected element and all references |
Alt+Shift+V |
Move selected element to other class or file (With complete method or class selected) |
Alt+Shift+C |
Change method signature (with method name selected) |
Alt+Shift+M |
Extract selection to?method |
Alt+Shift+L |
Extract?local variable: Create and assigns a variable from a selected expression |
Alt+Shift+I |
Inline selected local variables, methods, or constants if possible (replaces variable with its declarations/ assignment and puts it directly into the statements) |
▲ up
11. Run and Debug |
?? |
Ctrl+F11 |
Save and launch application (run) |
F11 |
Debug |
F5 |
Step Into function |
F6 |
Next step (line by line) |
F7 |
Step out |
F8 |
Skip to next Breakpoint |
▲ up
12. The Rest |
?? |
Ctrl+F7/Ctrl+Shift+F7 |
Switch forward / backward between views (panels). Useful for switching back and forth between Package Explorer and Editor. |
Ctrl+F8/Ctrl+Shift+F8 |
Switch forward / backward between perspectives |
Ctrl+P |
|
F1 |
Open Eclipse Help |
Shift+F10 |
Show Context Menu?right click with mouse |
▲ up
13. Team (SVN Subversive) |
?? |
Ctrl+Alt+S |
Synchronize with Repository |
Ctrl+Alt+C |
Commit |
Ctrl+Alt+U |
Update |
Ctrl+Alt+D |
Update to Revision |
Ctrl+Alt+E |
Merge |
Ctrl+Alt+T |
Show Properties |
Ctrl+Alt+I |
Add to svn:ignore |
▲ up
?
?
Uploaded by?bernd,?updated on 1/7/2017?by?bernd
?
?
来自 <https://shortcutworld.com/Eclipse/win/Eclipse-Helios_Shortcuts>