You are on page 1of 4

Eclipse

Eclipse IDE – Keyboard Shortcuts


1. Keyboard Shortcuts
Using keyboard shortcuts in my option is a huge productivity booster while developing the
application. The shortcuts specified are for Eclipse 3.0 version and higher.
(Eclipse 3.0 default keyboard shortcuts are available under Window -> Preferences -> Workbench -> Keys)

Below are some of the useful keyboard shortcuts, which can be used while developing the
application using Eclipse IDE.

• Open type (ctrl + shift + T)

This will open up a class in the workspace (or in dependencies such as jar-files), the dialog
accepts wildcards (for instance *Action), another nifty feature are the CamelCase notation to
quickly open a file, for instance if you want to open the class LinkViewAction entering LVA
would give you the correct result right away, and save you some typing.

• Open Resource (ctrl + shift + R)

Same tip as above, but it works on every resource (.jsp, .properties, .xml etc) in your
workspace, same tips for wildcards as above applies.

• Navigate to member (ctrl + O)

How do you navigate to a member (method, variable) one option (and most often used) is to
search for it using Ctrl + F, it’s really not that efficient, instead use this short cut to list all the
methods, to narrow the list start typing the method name navigate to the one you want with
the arrow keys and press enter. Even more, press the key another time and it will show you
the inherited members.

• Go to Line (ctrl + L)

Often you find a line number when digging through stack traces and such, to simply go to a
line in the open file press Ctrl + L and enter the line number.

• Go to last edit (ctrl +Q)

Do you know the scenario when you edit your large class file, and you change something in
one method, and want to go to the last thing you edited in before this? Instead of browsing to
the previous method, finding the right spot use this command to jump right back to the last
edit, use it multiple times to track back in history.

• Show type hierarchy (ctrl + T)

This is for showing the hierarchy.

Page 1 of 4
Eclipse

• Go to open editor (ctrl + E)

This is used for switching between the editors

• Next error/warning (ctrl + +.)

This command will cycle through the errors/warnings in the current file, instead of using the
Problems view.

• Move block of code (alt + arrow up/down)

This shortcut will move a line (or block) of code up/down one line much easier and faster
than cut’n’paste.

• Block comment/uncomment (Shift + Ctrl + /)

Instead of commenting out blocks of code with /* */ use this, it will make every selected line
commented out with a // , to remove the comment invoke this again to remove.

• Search workspace for references (ctrl + shift + G)

This shortcut is used to find the which all code are using the specified method or variable.

• Reformat code (ctrl + shift + F)

Apply the current code formatting to the open file,

• Organize imports (ctrl + Shift + O)

To organize the import orders.

• Build All (ctrl + B)

To start the build project process.

Below table have more keyboard shortcuts:

Short Description Keyboard Shortcut

Run/Debug Option
Open Search Dialog Ctrl + H
Sort Members
Debug Last Launched F11
Read Access in
Project

Page 2 of 4
Eclipse

Short Description Keyboard Shortcut


Surround With
Try/Catch Block
Display Ctrl + Shift + D
Read Access in
Working Set
Toggle Comment
Ctrl + / or Ctrl + 7
Execute Ctrl + U
Read Access in
Workspace
Uncomment
Inspect Ctrl + Shift + I
References in
Hierarchy
Resume F8
References in
Working Set
Run Last Launched Ctrl + F11
Navigate Project Option

Select All Ctrl + A


Back

Build All
Ctrl + B
Select Enclosing Element Alt + Shift + Up

Backward History
Alt + Left
Build Clean
Select Next Element Alt + Shift + Right
Forward

Build Project
Select Previous Element Alt + Shift + Left

Forward History
Alt + Right
Close Projec
Go to Line
Ctrl + L
Open Project
Show Tooltip Description F2

Go to Matching
Bracket Ctrl + Shift + P
Properties
Text Editing

Copy Lines Ctrl + Alt + Down


Delete Line Ctrl + D
Delete Next Word Ctrl + Delete

Page 3 of 4
Eclipse

Short Description Keyboard Shortcut


Delete Previous Word Ctrl + Backspace
Duplicate Lines Ctrl + Alt + Up
Move Lines Down Alt + Down
Move Lines Up Alt + Up
To Lower Case Ctrl + Shift + Y
To Upper Case Ctrl + Shift + X
Source
Add Import Ctrl + Shift + M
Add Javadoc Comment Alt + Shift + J
Format Ctrl + Shift + F
Mark Occurrences Alt + Shift + O
Indent Line Ctrl + I
Toggle Comment Ctrl + / or Ctrl + 7
Source Quick Menu Alt + Shift + S
Remove Occurrence Annotation Alt + Shift + U

Page 4 of 4

You might also like