As a developer, there are always things that we stumble across as we research and study/practice the art of coding, which, if we came across earlier, would have been so much more helpful. These moments make us say to ourselves, “Damn, this is a slick way to do it,” or “If only I knew it earlier, it would have saved so much time,” or “I know there should be a way to do it more efficiently, but I just can’t seem to find it.”
The only issue is that we fail to find these “awesome tips” as easily as we want to because we do not precisely know what is possible in the respective aspects of coding. If we do not know what we are looking for, finding it becomes increasingly difficult. Thus, we only stumble across these things when we start looking for related items. And boom! It pops up out of nowhere, and we start using it, and we find it so amazing that we tell ourselves if only we knew this earlier.
This article is about a few Eclipse shortcuts that I, as a Java Developer, use. In my opinion, these belong to the “awesome tips” category for any developer using Eclipse for their development. Also, the great thing about it is that even if you do not use Eclipse as your IDE, these shortcuts will exist, so at the least, this article will help you figure out what you want to search for.
Let’s start!
1. Ctrl/Cmd + 3 — Search for any Action
This shortcut is very underrated because if we are used to using our mouse to navigate the IDE and perform different tasks, we find it a little difficult to believe that using a keyboard shortcut would be more efficient/easier.
However, if you give it a try, you will find that it saves so much time and makes it so much easier to perform all kinds of actions built in the IDE without having to look for it in the menus or having to hit a complex set of shortcuts. You can even find different items inside properties/preferences from this shortcut. From running the project to changing the perspective, every action becomes available to you at your fingertips without having to leave your keyboard, which I believe boosts productivity and focus significantly.
2. Ctrl + H — Search for any text/code anywhere
Have you ever found yourself being overwhelmed at the sheer size of code at work, or even in your personal projects? Not understanding the flow or having trouble finding out where exactly is that piece of code supposed to be? Have you ever wished for a way to find any text in the whole project or even the entire workspace?
Press Ctrl + H and select File Search, and search for literally anything anywhere in the workspace. This search feature of Eclipse is beyond powerful.
3. Ctrl/Cmd + O — Class Outline
As the application grows, or even in small-scale applications, a particular class may come to have many member methods and variables. This becomes more and more complex as time passes; having the ability to have a birds-eye-view of the Class would make it much easier to understand and navigate the Class, would it not?
This shortcut gives you a list of all the member variables and methods of the Class and gives you a way to go to the particular method/variable quickly.
Bonus. Ctrl + M — Focus mode
The bonus tip/shortcut I would like to share with you guys is Ctrl + M. As you work on different stages of development, you open/close tons of windows/views such as Variables or Breakpoints or Console, to name a few, making the workspace as cluttered as it can get. I would recommend hitting Ctrl+ M on any window/view you are trying to focus on to have Eclipse hide all the other views and increase your focus on the particular task.
Thank you for reading!