Several shortcuts that must be mastered when using Eclipse (collected by xiaomao in the capability workshop) and eclipse xiaomao

Source: Internet
Author: User

Several shortcuts that must be mastered when using Eclipse (collected by xiaomao in the capability workshop) and eclipse xiaomao

"If you are doing well, you must first sharpen the tool." Thanks to Eclipse, she made it easier for us to read the code of a large project, I found that mastering several Eclipse shortcut keys will make the reading experience smoother. Write it out and share it with Zhu Jun. Please add it.


1. Ctrl + Left click 
This is frequently used by most people to view the definitions of variables, methods, and classes.

2. Ctrl + O 
View the outline of a class and list its methods and member variables. Tip: press Ctrl + O to list the methods and variables inherited by the class.
Note: "O" ---> "Outline" ---> "Outline"

3. Ctrl + T 
View the inheritance tree of a class, which is top-down. If you press Ctrl + T one more time, the structure is displayed from bottom to top.
Tip: select a method name and press Ctrl + T. You can view the parent class, subclass, and interface of the method with the same name.
Note: "T" -------> "Tree" -----> "Hierarchy Tree"

4. Alt + left and right direction keys 
We often encounter situations where we read the code by pressing Ctrl + left-click, trace them layer by layer, and then get lost in the Code. In this case, we only need to press "Alt + Left-direction key" to return to the last read position, similarly, pressing "Alt + right arrow key" will move to the returned reading position, just like the browser's forward and backward buttons.

5. Ctrl + Alt + H 
If you want to know whether a class method is called by other classes, select the method name and press Ctrl + Alt + H ", eclipse will display the methods called by this method, and ultimately generate a call relationship tree.

 

 

 

Ctrl + D: Delete the current row

 

 

Ctrl + Alt + ↓ copy the current row to the next row (copy added)

Ctrl + Alt + ↓ copy the current row to the previous row (copy added)

Alt + ↓ interaction position between the current row and the following row (especially practical, you can save cutting and pasting)

Alt + ↑ interaction between the current row and the previous row (same as above)

Alt + ↓ previous edited page

Alt + → next edited page (of course for the above)

Alt + Enter display the properties of the currently selected resource (project, or file)

Shift + Enter insert empty rows in the next row of the current row (the mouse can be at any position of the current row, not necessarily the last row)

Shift + Ctrl + Enter insert blank lines in the current line (same principle)

Ctrl + Q locate the Last edited location

Ctrl + L locate in a line (for those with more than 100 programs, there will be good news)

Ctrl + M maximize the current Edit or View (then press it, and vice versa)

Ctrl +/comment out the current row, and then press it to cancel the comment

Ctrl + O quick OutLine display

Ctrl + T quickly display the inheritance structure of the current class

Ctrl + W disable the current Editer

Ctrl + K quickly locate to the next one by referencing the selected Word

Ctrl + E: Click it to quickly display the drop-down list of the current Editer (if the current page is not displayed, it is displayed in bold)

Ctrl +/(keypad) collapse all code in the current class

Ctrl + × (keypad) show all the code in the current class

Ctrl + Space Code assistant inserts some code (but it is usually in conflict with the input method. You can modify the key of the input method or replace it with Alt +/for the moment)

Ctrl + Shift + E display the managers that manage all Opened Views (you can choose to close or activate them)

Ctrl + J forward incremental search (after pressing Ctrl + J, each letter editor you enter provides a quick match to locate a word. If not, it is not found in stutes line. It is particularly useful when querying a word. This function was available two years ago)

Ctrl + Shift + J reverse incremental search (the same as the previous one, but only from the back to the front)

Ctrl + Shift + F4 close all open Editer

Ctrl + Shift + X change all selected text to lowercase

Ctrl + Shift + Y change all selected text to lowercase

Ctrl + Shift + F format the current Code

Ctrl + Shift + P locate the matched character (for example, {}) (when positioning from the front, the cursor must be inside the matched character, followed by the front, and vice versa)

The following shortcut keys are commonly used in refactoring. I like them and want to sort them out frequently (note: the keys for refactoring generally start with Alt + Shift)

Alt + Shift + R Rename (one of my favorite ones, especially the Rename of variables and classes, which saves a lot of labor compared with manual methods)

Alt + Shift + M extraction method (this is one of the most common methods in refactoring, especially useful for a lot of mud code)

Alt + Shift + C modify the function structure (more practical. N functions call this method and modify it once)

Alt + Shift + L extract local variables (you can directly extract some magic numbers and strings into one variable, especially when multiple calls are performed)

Alt + Shift + F convert the local variable in the Class to the field variable (more practical)

Alt + Shift + I merge variables (this may be a bit inappropriate Inline)

Alt + Shift + V moving functions and variables (not commonly used)

Alt + Shift + Z restructured regret medicine (Undo)

Ctrl + Shift + U select the selected text, which is very similar to the UE list Query

Ctrl + Alt + H view the link level of a function called by other functions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.