List of key bindings

The list of available key bindings in Eclipse depends on many factors, including what view or editor is selected, whether a dialog is open, what plug-ins are installed, and what operating and windowing system is being used. At any time, you can obtain a list of available key bindings using Key Assist ( Help > Key Assist... or Ctrl+Shift+L). The following tables list some popular key bindings available in the Eclipse SDK.

 

File actions

New Create a Java element or a new resource. Configure which elements are shown in the submenu in Window > Customize Perspective. In a Java perspective, by default action for creating a project, package, class, interface , source folder, scrapbook, file and folder are available. Ctrl + N
Close Close the current editor. If the editor contains unsaved data, a save request dialog will be shown. Ctrl + F4
Close All Close all editors. If editor contains unsaved data, a save request dialog will be shown. Ctrl + Shift + F4
Save Save the content of the current editor. Disabled if the editor does not contain unsaved changes. Ctrl + S
Save As Save the content of the current editor under a new name.
Save All Save the content of all editors with unsaved changes. Disabled if no editor contains unsaved changes. Ctrl + Shift + S
Print Prints the content of the current editor. Enabled when an editor has the focus. Ctrl + P
Properties Opens the property pages of the select elements. Opened on Java projects the Java Build Path page and the Javadoc Location page are available. For JAR archives, configure the JAR's Source Attachment and Javadoc Location here. Alt + Enter

Edit actions

Undo Revert the last change in the editor Ctrl + Z
Redo Revert an undone change Ctrl + Y
Cut Copies the currently selected text or element to the clipboard and removes the element. On elements, the remove is not performed before the clipboard is pasted. Ctrl + X
Copy Copies the currently selected text or elements to the clipboard Ctrl + C
Paste Paste the current content as text to the editor, or as a sibling or child element to the a currently selected element. Ctrl + V
Delete Delete the current text or element selection. Delete
Select All Select all the editor content.. Ctrl + A
Find / Replace Open the Find / Replace dialog. Editor only. Ctrl + F
Find Next Finds the next occurrence of the currently selected text. Editor only. Ctrl + K
Find Previous Finds the previous occurrence of the currently selected text. Editor only. Ctrl + Shift + K
Incremental Find Next Starts the incremental find mode. After invocation, enter the search text as instructed in the status bar. Editor only. Ctrl + J
Incremental Find Previous Starts the incremental find mode. After invocation, enter the search text as instructed in the status bar. Editor only. Ctrl + Shift + J
Add Task Add a user defined task to the current text selection or selected element. Alt + Enter
Expand Selection to Enclosing Element: Selects the enclosing expression, block, method in the code. This action is aware of the Java syntax. It may not function properly when the code has syntax errors. (Arrow Up). Alt + Shift + Arrow Keys
Next Element: Selects the current and next element. (Arrow Right)
Previous Element: Selects the current and the previous element (Arrow Left)
Restore Last Selection: After an invocation of Expand Selection to restore the previous selection. (Arrow Down)
Show Tooltip Description Shows the value of a hover that would appear at the current cursor location. The dialog shown is scrollable and does not shorten descriptions. F2
Content Assist Opens a context assist dialog at the current cursor position to bring up Java code assist proposals and templates. See the Templates preference page for available templates (Window > Preferences > Java > Editor > Templates) and go to the Editor preference page (Window > Preferences > Java > Editor > Code Assist) for configuring the behavior of code assist. Ctrl + Space
Quick Fix If the cursor is located at a location with problem indication this opens a context assist dialog at the current cursor to present possible corrections. Ctrl + 1
Parameter Hints If the cursor is located at the parameter specification for method reference, this actions shows a hover with parameter types information.The parameter at the current cursor location is shown in bold. Ctrl + Shift + Space

Navigate actions

Open Tries to resolve the element referenced at the current code selection and opens the file declaring the reference. F3
Open Type Hierarchy Tries to resolve the element referenced at the current code selection and opens the element in the Type Hierarchy view. Invoked on elements, opens the type hierarchy of the element. Supported in the Java editor and views showing Java elements. F4
Open External Javadoc Opens the Javadoc documentation of the currently selected element or text selection. The location of the Javadoc of a JAR or a project is specified in the Javadoc Location property page on projects or JARs. Note that this external Javadoc documentation may not be up to date with the Javadoc specified in the current code. You can create Javadoc documentation for source files in a Java project using the Javadoc export wizard. Shift + F2
Open Type Brings up the Open Type selection dialog to open a type in the editor.The Open Type selection dialog shows all types existing in the workspace. Ctrl + Shift + T
Open Type In Hierarchy Brings up the Open Type selection dialog to open a type in the editor and the Type Hierarchy view. The Open Type selection dialog shows all types that exist in the workspace. Ctrl + Shift + H
Show Outline Opens the lightweight outliner for the currently selected type. Ctrl + O
Go to Next Problem Selects the next problem. Supported in the Java editor. Ctrl + . (Period)
Go to Previous Problem Selects the previous problem. Supported in the Java editor. Ctrl + , (Comma)
Go to Last Edit Location Reveal the location where the last edit occurred. Ctrl + Q
Go to Line Opens an a dialog which allows entering the line number to which the editor should jump to. Editor only. Ctrl + L

Search actions

Search... Opens the search dialog Ctrl + H
Occurrences in File Finds all occurrences of the selected Java element in its file Ctrl + Shift + U

Project actions

Build All Builds the all projects in the workspace. This is an incremental build, means that the builder analyzes the changes since the last time of build and minimizes the number of changed files. Ctrl + B

Source actions

Comment Comments out all lines containing the current selection. Ctrl + /
Uncomment Uncomments all lines containing the current selection. Ctrl + \
Indent Indent current line. Ctrl + I
Shift Right Increments the level of indentation of the currently select lines. Only activated when the selection covers multiple lines or a single whole line. Tab
Shift Left Decrements the level of indentation of the currently select lines. Only activated when the selection covers multiple lines or a single whole line. Shift + Tab
Format Uses the code formatter to format the current text selection. The formatting options are configured on the Code Formatter preference page (Window > Preferences > Java > Code Formatter) Ctrl + Shift + F
Organize Imports Organizes the import declarations in the compilation unit currently open or selected. Unnecessary import declarations are removed, and required import declarations are ordered as specified in the Organize Import preference page (Window > Preferences > Java > Organize Import). Organize import can be executed on incomplete source and will prompt you when a referenced type name can not be mapped uniquely to a type in the current project. You can also organize multiple compilation units by invoking the action on a package or selecting a set of compilation units. Ctrl + Shift + O
Add Import Creates an import declaration for a type reference currently selected. If the type reference if qualified, the qualification will be removed if possible. If the referenced type name can not be mapped uniquely to a type of the current project you will be prompted to specify the correct type. Add Import tries to follow the import order as specified in the Organize Import preference page. Ctrl + Shift + M

Refactor actions

Undo Does an Undo of the last refactoring. The refactoring undo buffer is only valid as long as no other source changes than refactoring have been performed. Alt + Shift + Z
Redo Does a Redo of the last undone refactoring. The refactoring undo/redo buffer is only valid as long as no other source changes than refactoring have been performed. Alt + Shift + Y
Rename Starts the Rename refactoring dialog: Renames the selected element and (if enabled) corrects all references to the elements (also in other files). Is available on methods, fields, local variables, method parameters, types, compilation units, packages, source folders, projects and on a text selection resolving to one of these element types. Alt + Shift + R
Move Starts the Move refactoring dialog: Moves the selected elements and (if enabled) corrects all references to the elements (also in other files). Can be applied to one instance method (which can be moved to a component), one or more static methods, static fields, types, compilation units, packages, source folders and projects and on a text selection resolving to one of these element types. Alt + Shift + V
Inline Starts the Inline refactoring dialog. Inlines local variables, methods or constants. This refactoring is available on methods, static final fields and text selections that resolve to methods, static final fields or local variables. Alt + Shift + I
Extract Method Starts the Extract Method refactoring dialog. Creates a new method containing the statements or expression currently selected and replaces the selection with a reference to the new method. You can use Expand Selection from the Edit menu to get a valid selection range. This feature is useful for cleaning up lengthy, cluttered, or overly-complicated methods. Alt + Shift + M
Extract Local Variable Starts the Extract Variable refactoring dialog. Creates a new variable assigned to the expression currently selected and replaces the selection with a reference to the new variable. This refactoring is available on text selections that resolve to local variables. You can use Expand Selection from the Edit menu to get a valid selection range. Alt + Shift + L

Related information

Navigating the user interface using the keyboard
Keys and accessibility for the workbench