As developers, the more we keep our hands on the keyboard the more productive we can be. Today we’re going to look at using keyboard shortcuts for managing the arrangement of Eclipse editors and windows, referred to collectively as Eclipse Perspectives.
We developers like our IDE layout “just so,” optimized for the task at hand, whether it be coding, building in Gradle, testing, debugging, whatever we’re doing at the time. We’re all familiar with out-of-the-box Eclipse Perspectives like Java EE, Java and Debug, but we often forget about the ability to create Custom Perspectives. In this post we’re going to show how Custom Perspectives and keyboard assignments will keep our hands on the keys and the code churning out at a fever pace.
To create a Custom Perspective, open the IDE elements you want, arrange them the way you like them and use the Perspective Menu “Save Perspective As…” option.
We’re going to name our Perspective “Heads Down” because we’re Heads Down coding away with an editor and our Package Explorer on the left.
We’re going to assign a shortcut to show the Perspective instantly with the windows arranged and sized just the way we want them when we created it. I’m using Alt-E H.
While we’re coding along we’re going to want to open up various Eclipse Views like in the example below (using their respective keyboard shortcuts to open them, of course.)
Alert! The post’s Super Duper Productivity Tip is coming up! Wouldn’t it be sweet to have Eclipse snap back instantly to our clean Heads Down layout without grabbing the mouse and closing views? Fortunately Eclipse has a “Reset Perspective” option. We can assign that bad boy to a keyboard shortcut (I used Alt-R) and our IDE is back to a clean Heads Down mode instantly.
Woo-boy! Back to churning out that code!
Before I sign-off, don’t forget about creating Custom Perspectives for the task at hand. Here’s an example of a Gradle Perspective with the Gradle Tasks View on the right and a full Console display for the output.