Hey, tea lovers! Today we will talk about the Eclipse IDE shortcuts. Eclipse is an Open-source & Powerpack IDE. Believe it or not, almost every Java Developer has used this IDE. In fact, in most organizations, you will find that developers are using Eclipse IDE. Its extensive plugins & customization add-on system make it easy to use and enhance the developer experience.
In the market, we have many IDE’s but eclipse provides all the functionality free of cost, unlike IntelliJ IDEA. It supports and distributes many languages along with Java, such as C/C++, PHP, etc. So having hands-on Eclipse makes it easy to code in any language without changing IDE.
Now let’s look at the shortcuts in Eclipse IDE. This makes you more productive since you don’t have to leave your keyboard and point out the direction to click via mouse. Few of these shortcuts are very important and others are used not that frequently. To be honest, You don’t gotta catch them all. We will take a look at shortcuts that you will require more often than others.
This post is an addition to our post series to improve your productivity through IDEs. We already have written posts around it. You can learn about the Intellij IDEA shortcuts in You Only Need These 7 IntelliJ IDEA Shortcuts to Skyrocket Your Productivity.
Productivity can be improved with the plugins. You can find all the latest IDEs and their must-have plugins on, Extensions every Programmer needs for their IDE. We discussed these for IntelliJ IDEA, Eclipse IDE and VSCode. Please do check them out.
Let’s just jump right into it & explore shortcuts. But before preparing your cup of tea to sip and learn.
Show Proposals : Ctrl + Space
This shortcut will show all available proposals/options for the selected class & method. This gives you more information on how many implementations are available. There are different proposals available in eclipse so you can jump to the next proposal by pressing the same keys again.
When there are many files and packages you don’t want to search manually and look for the file you need. You can use the following shortcut to do that for you.
Search Resource dialog to open files by name or path with Ctrl + Shift + R.
Ctrl + H is to Search Widget to help search anything in the workspace
In Java file Ctrl + O will help to search in method and variable
Show View : Alt + Shift + Q
On the bottom of Eclipse IDE, we have many tabs as Error Log, console, search, etc. At the time of coding, we often switch between these tabs. It’s very annoying to use the mouse every time to switch between them. Hold down Alt + Shift + Q then release, it will show the list and select the one you like to open.
Organize Import : Ctrl + Shift + O
Import statements can get cluttered sometimes. This shortcut will clean it for you. If there is any unused import in the file then it will get removed. Also, if there is any missing import statement, then it will get added to the file assuming there are no multiple classes with the same name.
Code Editor Shortcuts
Working with the editor, we need to perform many operations along with typing. So I decided to divide them according to their use. Let’s look at them one by one.
Ctrl + W: Closes the currently active code editor
Ctrl + Shift + W: Closes all opening code editors
Navigate In Editor
Alt + left: Editor going left or backward by word by word on a line
Alt + right: Editor tab going right or forward by word by word on a line
Ctrl + Shift + Up: Navigate to the upward direction in Editor by variables and methods
Ctrl + Shift + Down: Navigate to the downward direction in Editor by variables and methods
Ctrl + K: Select on any string & then press Ctrl + K, & On each press, it will navigate to the next match.
Ctrl + Q: Navigate to the last edited place
Ctrl + 1: Quick Fix option for that selected part
Ctrl + E: It open dialog for all open active editor to navigate
Ctrl + Shift + P: To find closing & opening brace for that code.
Ctrl + L: On hit this shortcut in the editor it will ask for a line of code where you have to go
Other Shortcut In Editor
Ctrl + D: Delete current line
Ctrl + Shift + : Format code in current open editor
Ctrl + Shift + G: Searches the workspace for references to the selected method or variable
Alt + Shift + J: To add Java-doc in Java source file
Alt + Shift + S + R: First click on Alt + Shift + S, It will open dialog than press S then Generate getter and setter methods
Alt + Shift + R: Rename selected method or variable occurrence in all dependent places
Alt + Shift + L: selected variable Extract to new Local Variable
Alt + Shift + M: selected portion of code Extract to new Method
Ctrl + /: – toggle for Comment/Uncomment selected code portion
Forgot the shortcuts?
In case you forgot the shortcut simply press Ctrl + Shift + L. the popup window that will contain a complete list of shortcuts available in Eclipse IDE will appear.
And the final note
As I said, there are countless other shortcuts in the Eclipse IDE, but this some of the lists of shortcuts that I use commonly But you can go beyond this & learn as many shortcuts as possible, also don’t forget to check the Intellij shortcut here You Only Need These 7 IntelliJ IDEA Shortcuts to Skyrocket Your Productivity. How many shortcuts to learn? well until you can do the following.
You should be able to code without touching the mouse.
That’s it guys for this post. Tell me if these shortcuts are enough or you would like to add more. If you have more shortcuts or you want to add more with your comments, Till that you can check posts on best practices to boost your performance. & for our latest post subscribe to our social media handle from there we will keep you updated, See you at your next tea time.