Eclipse shortcuts _ 10 Most Efficient Shortcuts

Source: Internet
Author: User

1. CTRL + Shift + R: Open the resource

This may be the most time-efficient combination of all shortcut keys. This set of shortcuts allows you to open any file in your workspace, and you only need to press the file name or the first few letters in the mask name, such as applic *. xml. The disadvantage is that this set of shortcut keys are not available in all views.

2. CTRL + O: Quick outline

If you want to view the method of the current class or a specific method, but do not want to pull the code down or use the search function, press Ctrl + O. It lists all methods and attributes of the current class. You only need to enter the name of the method you want to query and click Enter to directly jump to the desired location.

3. CTRL + E: Quick conversion Editor

This set of shortcut keys will help you browse between open editors. You can use Ctrl + Page down or Ctrl + page up to browse the front and back tabs. However, CTRL + E is more efficient when many files are opened.

4. CTRL + 2, L: assign values to local variables

During development, I often write a method, such as calendar. getinstance (), and then assign the calculation result of the method to a local variable by pressing CTRL + 2. In this way, the input class name, variable name, and import declaration time are saved. The effect of Ctrl + F is similar, but the effect is to assign the calculation result of the method to the domain in the class.

5. Alt + Shift + R: Rename

Renaming properties and methods was a hassle a few years ago and requires a lot of search and replacement, so that the Code became scattered. Today's Java ide provides the source code processing function, as is eclipse. Now, renaming variables and methods is very simple, and you will get used to renaming every time a better alternative name appears. To use this function, move the mouse over the attribute or method name, press Alt + Shift + R, enter a new name, and press Enter. This is done. If you Rename an attribute in the class, you can click Alt + Shift + R twice. This will call the source code processing dialog box and automatically rename the get and set methods.

6. Alt + Shift + L and ALT + Shift + M: extract local variables and Methods

Source code processing also includes the ability to extract variables and methods from large pieces 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 category, it will be automatically replaced. Method extraction is also a very convenient function. Decomposing large methods into small and fully-defined methods will greatly reduce complexity and improve code testability.

7. Shift + enter and CTRL + Shift + enter

Shift + enter creates a blank row under the current row, regardless of whether the cursor is at the end of the row. CTRL + Shift + enter insert a blank row before the current row.

8. Alt + direction keys

This is also a magic weapon to save time. This combination moves the content of the current row up or down. In the try/catch section, this shortcut is particularly useful.

9. CTRL + m

Large display screens can improve work efficiency. CTRL + m is the shortcut key for maximizing the size of the editor window.

10. CTRL +. And Ctrl + 1: Next error and quick Modification

CTRL +. move the cursor to the next error or warning area in the current file. I usually use this set of shortcut keys together with Ctrl + 1, that is, modify the recommended shortcut keys. The modification suggestions for the new version of eclipse are very good and can help you solve many problems, such as missing parameters in methods, throw/catch exception, and unexecuted methods.

For more shortcut keys, press Ctrl + Shift + L in eclipse.

Author: jason0539

Weibo: http://weibo.com/2553717707

Blog: http://blog.csdn.net/jason0539 (reprinted please explain the source)

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.