Skilled in some shortcut keys, will make your development faster and more efficient, it is worth spending some time to learn!
1. Ctrl+shift+r: Open Resource
This is probably the most time-saving combination of all shortcut keys. This set of shortcuts lets you open any file in your workspace, and you only need to press the first few letters of the file name or mask name, such as Applic*.xml. The drawback is that this set of shortcuts is not available in all views.
2. Ctrl+o: Fast Outline
If you want to see the methods of the current class or a particular method, but do not want to pull the code down, and do not want to use the search function, then use Ctrl+o bar. It can list all the methods and properties in the current class, you just enter the method name you want to query, and click Enter to jump directly to where you want to go.
3. Ctrl+e: Quick Convert editor
This set of shortcut keys will help you navigate between the open editors. Use ctrl+page down or ctrl+page up to browse the tabs before and after, but ctrl+e is more efficient when many files are open.
4. Ctrl+2,l: Assigning a value to a local variable
During development, I often write methods, such as calendar.getinstance (), and then assign the results of a method to a local variable by ctrl+2 shortcut keys. This saves me the input class name, the variable name, and the time the declaration was imported. The ctrl+f effect is similar, but the effect is to assign the result of the method to a field in the class.
5. Alt+shift+r: Renaming
Renaming properties and methods was a hassle a few years ago, requiring a lot of searching and replacing so that the code became fragmented. Today's Java IDE provides source-processing functionality, as is eclipse. Now, the renaming of variables and methods is very simple, and you'll get used to renaming each time a better alternative name appears. To use this feature, move the mouse over the property name or method name, press Alt+shift+r, enter a new name, and then click Enter. This is done. If you rename a property in the class, you can click Alt+shift+r two times, this will call out the Source Processing dialog box, you can implement the get and set method of automatic renaming.
6. Alt+shift+l and Alt+shift+m: Extracting local variables and methods
source processing also includes the ability to extract variables and methods from chunks of code. For example, to create a constant from a string, select the text and press Alt+shift+l. If the same string appears elsewhere in the same class, it is automatically replaced. The method extraction is also a very convenient function. Breaking up large methods into smaller, well-defined methods can greatly reduce complexity and improve the testability of your code.
7. Shift+enter and Ctrl+shift+enter
Shift+enter creates a blank line below the current line, regardless of whether the cursor is at the end of the row. Ctrl+shift+enter inserts a blank line before the current line.
8. ALT + arrow key
This is also a magic weapon to save time. This combination moves the contents of the current line up or down. In the Try/catch section, this shortcut is especially useful.
9. Ctrl+m
large display screen can improve productivity is known to everyone. Ctrl+m is the shortcut key for maximizing the editor window.
Ctrl +. and Ctrl+1: Next error and quick change
Ctrl +. Moves the cursor to the next report fault or warning in the current file. This set of shortcut keys I generally use with ctrl+1, that is, modify the proposed shortcut keys. The new version of Eclipse suggestions are good to help you solve a lot of problems, such as missing parameters in the method, Throw/catch exception, non-executed methods and so on.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Common shortcut keys in eclipse