Eclipse most often uses shortcut key summary

Source: Internet
Author: User
Tags class definition

1. Ctrl+shift+r: Open Resource

This is probably the most time-saving combination of all shortcut keys.

This set of shortcuts allows you to open any file in your workspace, and you just need to press the first few letters of the file name or mask name, for example Applic*.xml. The drawback is that this set of shortcuts is not available in all views.


2. Ctrl+o: High-speed 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 methods and properties in the current class. Just enter the name of the method you want to query, and click Enter to jump directly to where you want to go.


3. Ctrl+e: High-speed conversion editor

This set of shortcut keys will help you navigate between the open editors. Use ctrl+page down or ctrl+page up to navigate the tabs before and after. But in a very many files open state. Ctrl+e will be more efficient.


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 effect of ctrl+f 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 it was a very troublesome thing a few years ago, and it required a lot of searching and replacing so that the code became fragmented. Today's Java IDE provides source-code processing capabilities. Eclipse is the same. Now. Renaming variables and methods is straightforward. You'll get used to renaming every 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 over. Suppose you rename a property in a class. You can click Alt+shift+r two times, this will call out the Source Code Processing dialog box, you can implement the get and set methods of their own active renaming.

6. Alt+shift+l and Alt+shift+m: Extracting local variables and methods

Source code processing also includes the ability to extract variables and methods from chunks of code. Example. To create a constant from a string. Then select the text and press Alt+shift+l to do so. Assume that the same string appears elsewhere in the same class. It will be replaced by its own initiative.

The method extraction is also a convenient function. Breaking the generosity into smaller, well-defined methods can greatly reduce complexity and improve the code's scalability.

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 form.

CTRL +. And Ctrl+1: Next error and high-speed change

CTRL +. Move 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, change the proposed shortcut keys. The new eclipse changes suggest doing a great job and can help you solve a lot of problems. such as missing parameters in the method. Throw/catch exception, non-running methods, and so on.


Part II:

1. Ctrl + Left and F3

This is most often used by most people. Used to view the definitions of variables, methods, classes
Jumps to the definition code of the identifier where the cursor is located. When reading by running process, F3 implements most navigation actions.

2 Ctrl+shift+g
Finds the location in the workspace that references the identifier where the cursor is located. Can be said to be the opposite of F3 shortcut keys. When reading by class definition, you can quickly find out which classes the current class method is calling.

3. Ctrl+t

Look at the inheritance tree of a class, which is top-down, and then press once more ctrl+t, which is replaced by a bottom-up display structure. Unlike the "F4" shortcut, it is displayed in a different way.

tip : Select a method name and press Ctrl+t to see the parent class, subclass, and interface of the method with the same name.

mnemonic : "T"-------> "tree"-----> "Hierarchy tree"

4.alt+ left and RIGHT ARROW keys

We often encounter Ctrl + left when looking at the code. Layers of tracking, and then lost in the code of the case, just need to press "ALT + LEFT ARROW key" can be returned to the last reading position, similarly, press "ALT + RIGHT ARROW key" will advance to just

The reading position is returned, just like the browser's forward and rewind buttons.

Alt+--> returns to the previous reading position. After jumping using the Find feature or navigation function, you can return to the previous reading position with the alt-left arrow and a multi-level history.

Like IE's backwards. To achieve the best effect of this retreat

Rate, it is necessary to develop the habit of using it, such as encountering a method call. Use F3 to open the class file where it is, and then apply the alt-left arrow to go back after reading it. Instead of just turning off the newly opened tab.

Otherwise, this newly opened tab will

Will be recorded in history, and will be opened again the next time you come back here.

5.ctrl+alt+h

If you want to know how a class's methods are called by those other classes, check this method name. Then press "Ctrl+alt+h". Eclipse will show which methods are called by this method. Finally, a call tree is generated.

mnemonic : "H"---> "Hierarchy"---> "Call hierarchy"

6. control-q: Go back to the last editing place. This shortcut is also used when you jump in the code.

Especially when you're too deep, and forget what you were doing in the first place.

7 control-/: Gaze at or cancel the gaze on a line. Same applies for multiple lines.

8. Control-alt-down Arrow: Duplicates the highlighted row or rows.

9. Alt-down arrow: Moves one or more lines down. Alt-up Arrow will move up.

Eclipse most often uses shortcut key summary

Related Article

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.