Several shortcuts that must be mastered when using Eclipse

Several shortcuts that must be mastered when using Eclipse

"If you do a good job, you must first sharpen your tool." Thanks to Eclipse, she makes it easier for us to read the code of a large project. During the reading process, I found that mastering a few Eclipse shortcut keys will make the reading experience smoother , write it out to share with you, welcome to add.

  1. Ctrl+left key
    This is often used by most people to view the definitions of variables, methods, and classes

  2. Ctrl+O
    View the outline of a class, listing its methods and member variables. Tip: Press Ctrl+O one more time to list the inherited methods and variables of this class.
    Mnemonic: "O" -> "Outline" -> "Outline"

  3. Ctrl+T
    Views the inheritance relationship tree of a class, which is top-down. Press Ctrl+T again, and it will be replaced with a bottom-up display structure.
    Tip: Select a method name and press Ctrl+T to view the parent class, subclass, and interface with the method with the same name.
    Mnemonic: "T"--->"Tree"--->"Hierarchy tree"

4.Alt+left and right arrow keys
We often encounter the situation that Ctrl+left key when looking at the code, trace layer by layer, and then get lost in the code, then just press "Alt+left arrow key" to return to the last reading position , in the same way, pressing "Alt+Right Arrow" will advance to the reading position just returned, just like the browser's forward and back buttons.

5. Ctrl+Alt+H
If you want to know which methods of a class are called by other classes, then please select the method name, and then press "Ctrl+Alt+H", Eclipse will show which methods this method is called by. call, and finally generate a call relationship tree.

Ctrl+D: delete the current line

Ctrl+Alt+↓ Copy the current line to the next line (copy increase)

Ctrl+Alt+↑ Copy the current line to the previous line (copy increase)

Alt+↓ The interaction position between the current line and the next line (especially practical, you can save the first cut and then paste)

Alt+↑ the current line and the above line interactive position (same as above)

Alt+← Previous edited page

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

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

Shift+Enter inserts a blank line in the next line of the current line (the mouse can be anywhere in the current line, not necessarily the last)

Shift+Ctrl+Enter inserts a blank line in the current line (the principle is the same as the previous one)

Ctrl+Q to navigate to the last edited place

Ctrl+L locates on a certain line (good news for those with more than 100 programs)

Ctrl+M maximizes the current Edit or View (and vice versa)

Ctrl+/ Comment the current line, press again to uncomment

Ctrl+O Quickly display OutLine

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

Ctrl+W closes the current Editor

Ctrl+K Refer to the selected Word to quickly navigate to the next one

Ctrl+E Quickly display the drop-down list of the current Editor (if the current page is not displayed in bold)

Ctrl+/(keyboard) Collapse all code in the current class

Ctrl+× (keyboard) Expand all code in the current class

Ctrl+Space The code assistant completes the insertion of some code (but generally it conflicts with the input method, you can modify the hotkey of the input method, or you can temporarily use Alt+/ instead)

Ctrl+Shift+E Displays the manager that manages all currently open Views (you can choose to close, activate, etc.)

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 will be displayed in the stutes line that it is not found, check one It is especially useful when using words, Idea has this function two years ago)

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

Ctrl+Shift+F4 closes all open editors

Ctrl+Shift+X Change all selected text to lowercase

Ctrl+Shift+Y Change the currently selected text to lowercase

Ctrl+Shift+F Format current code

Ctrl+Shift+P locates the matching character (such as {}) (when positioning from the front to the back, the cursor should be in the matching character, from the back to the front, and vice versa)

The following shortcut keys are commonly used in refactoring, and I like to sort out the ones I like and commonly use (Note: The shortcut keys for general refactoring all start with Alt+Shift)

Alt+Shift+R Rename (it's my favorite one, especially the Rename of variables and classes, which saves a lot of labor than manual methods)

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

Alt+Shift+C Modify the function structure (more practical, there are N functions that call this method, modify it once)

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

Alt+Shift+F Change the local variable in the Class to the field variable (a more practical function)

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

Alt+Shift+V Move functions and variables (not very common)

Alt+Shift+Z Refactoring regret medicine (Undo)

Ctrl+Shift+U After selecting the selected text, it is very similar to UE's list query

Ctrl+Alt+H View the relationship level of a function being called by other functions

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325471972&siteId=291194637