Eclipse is a well-known, widely used, etc. IDE.
In this post you can find some tips for programmers on how to use it effectively. Effectiveness is usually boosted with keyboard shortcuts and here are the most useful ones:
- CTRL+SHIFT+R – open resource. Instead of searching a file in the navigation tree with sometimes a thousand resources (files, images,…) with this command you open dialog and search by resource name. You may well use special character ‘*’ like ‘*Manager.java” to list all .java files that end with ‘Manager’.
- Select a part of the code (e.g. character sequence) and then press CTRL+K. This command searches for the next occurrence of selected string (downwards). CTRL+SHIFT + K searches for the previous occurrence (upwards). This is much better than CTRL+F for simple string searches since it doesn’t pop-up dialog which obscures content.
- You don’t have to code getters and setters “by hand”. Pressing ALT+SHIFT+S and then R pops dialog for generating getters and setters in which you can quickly generate those methods for all properties that currently don’t have them.
- If you have some error or warning at the specific line you can try pressing CTRL+1 to see the list of quick fixes Eclipse can find. You choose the one you like and press ENTER to implement it.
- Try also this – CTRL+J and start typing the character sequence you want to find in the current page. When you find it you can continue with CTRL+K and CTRL+SHIFT+K to quickly move downwards or upwards searching for other sequence occurrences.
- Another time saver is automatic hashCode and equals generator (ALT+SHIFT+S and then H).
- Additionally, CTRL + O – and you go directly to a member (method, variable) of a large class file.
- You can hop back and forth through the places you have visited by pressing ALT + ← and ALT + →, respectively. This is especially useful when you want to go back to previously edited content, change something, and then continue to code from where you have been.
- Go to a type declaration: F3. You can achieve the same by holding CTRL down and clicking the hyperlinked variable or class but using keyboard is more effective.
Enough for now from me. If you have any other suggestion related to Eclipse shortcuts and your hint doesn’t require you to start Eclipse and search for help in order to put it in the comment (I mean you use it frequently), then please comment this article.