eclipse shortcuts
TRANSCRIPT
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 3
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 + HDebug Last Launched
Block
F11
Display Ctrl + Shift + D
Page 2 of 3
Eclipse
Short Description Keyboard Shortcut
Ctrl + / or Ctrl + 7Execute Ctrl + U
Inspect Ctrl + Shift + I
Resume F8Run Last Launched Ctrl + F11Navigate Project Option
Select All
Ctrl + B
Ctrl + A
Select Enclosing ElementAlt + Left
Alt + Shift + Up
Select Next Element Alt + Shift + Right
Select Previous ElementAlt + RightGo to LineOpen Project
Alt + Shift + Left
Show Tooltip DescriptionCtrl + Shift + P
F2
Text Editing
Copy Lines Ctrl + Alt + DownDelete Line Ctrl + DDelete Next Word Ctrl + DeleteDelete Previous Word Ctrl + BackspaceDuplicate Lines Ctrl + Alt + UpMove Lines Down Alt + DownMove Lines Up Alt + UpTo Lower Case Ctrl + Shift + YTo Upper Case Ctrl + Shift + XSource
Add Import Ctrl + Shift + MAdd Javadoc Comment Alt + Shift + JFormat Ctrl + Shift + FMark Occurrences Alt + Shift + OIndent Line Ctrl + IToggle Comment Ctrl + / or Ctrl + 7Source Quick Menu Alt + Shift + SRemove Occurrence Annotation Alt + Shift + U
Page 3 of 3