- Alt + Up or Down Arrow: This shortcut moves a line of code up or down based on the directional arrow you choose. Identation is respected so if you move a line of code inside of something like a loop or conditional you maintain formatting.
- CTRL + Shift + F: Formats the code. This is a real time saver especially if you have a custom formatter defined for your workspace.
- CTRL + Alt + Up or Down Arrow: Duplicates a line of code. I find myself using this shortcut when making variable declarations.
- CTRL + Shift + T: Opens a Type. Simliar to CTRL + Shift + R (open a resource) but this is more precise when you're truly looking to find a type and not a file in your workspace.
- CTRL + Shift + O: Organizes imports. My code always feels amateur until I remove all of the unnecessary imports along with removing the blanket import statements (e.g., some.package.*).
- Alt + Shift + R: Refactor. I'm not sure when Eclipse added the UI-sugar that live updates your code during a refactor operation but I like it!
- CTRL + H: Search, not find. Not a huge fan of the search utility but sometimes it can't be avoided.
- CTRL + /: Toggle Comment. Another huge time saver especially when you're trying to diagnose an offending block of code. For the purists at heart, the CTRL+Shift+\ and CTRL+Shift+/ add and remove (respectively) block comments.
- CTRL + W: Close window. Definitely not revolutionary but I feel this one is often overlooked.
- CTRL + L: Go to line. For the moments when your stack traces appear in a separate log file and not in a console inside of eclipse (where a hyperlink is usually provided if the source is available).
Thoughts and discussions about technology with a focus on computer science/software engineering topics.
Wednesday, January 20, 2010
My Top 10 Commonly Used Eclipse Shortcuts
Since getting reaquainted with the Eclipse IDE in the past few months I thought I'd share my top 10 most commonly used keyboard shortcuts (along with some commentary of course):
Subscribe to:
Post Comments (Atom)
1 comment:
I'm not sure of the Windows equivalents, but on OS X I use the following Eclipse shortcuts:
Cmd+G - Search for occurrences of selected item in workspace.
Cmd+T - Display type hierarchy for the selected item.
Shift+Cmd+F11 - Run last launched program.
Post a Comment