Improve eclipse Efficiency

Source: Internet
Author: User

Common shortcut keys for editing code

Ctrl + Shift + F

The shortcut key for formatting indentation is Ctrl + I. You can only indent the selected text.

The shortcut for deleting a row is Ctrl + D.

Maximize the current window and minimize the switch Ctrl + M

Go to the last modification location Ctrl + Q

Quick Search for the selected character Ctrl + K (down) Ctrl + Shift + K (up)

Place the cursor in one bracket and switch to another pair of parentheses Ctrl + Shirt + P

Switch Alt + left and right direction keys at the edited position

Common shortcuts for reading code

F3 does not explain (some people prefer to use Ctrl + left mouse button)

Select the method or variable Ctrl + Alt + H to find where to call, and quickly read the code and evaluate the code modifications that must be used

Inheritance relationship F4, understanding the code framework

Quick Search for functions and variables Ctrl + O. It is much faster to enter the names of functions or variables than to find them one by one in Outline, but you need to understand the code.

Search for Ctrl + H throughout the project, which is essential when there are too many codes.

Due to the limited level, I only use these shortcut keys

If you want to know other shortcut keys, Ctrl + Shift + L

Custom formatting code

Open Java Format in Preference

The built-in template cannot be modified. Click New... and enter a name to create a New template. The custom Edit window is displayed.

A variety of projects can be defined, and you can preview them on the right. Even if you are not familiar with English, you can also figure out the general meaning. The advantage of formatting the Code is that it is not only beautiful, but also easy to read. During team development, the uniform format can be used to avoid many conflicts when merging the code. The modified template is the template when Ctrl + Shift + F is used for formatting.

Automatically Remove useless import, automatically complete @ Override and @ deprecated, Clean up of eclipse

In Code Style, besides Format, Clean Up

Perform the same operation as Format. Create a template. I decided to change it in a few places.

InCode OrganizingLabel SelectionRemove trailing whitespace(Remove trailing spaces)

AndOrganzie imports

Select effect before Organzie imports

 org.model.*;

Effect after Organzie imports is selected

 org.model.Engine;

Switch to the Code Style label

 

Use blocks in if/while/for/do statementsIsIf/while/for/doBrackets are automatically added, which varies from person to person. I decided to add parentheses even if only one row is used.

Click Source-Clean up in the menu to Clean up the code. The biggest advantage of clearing the code is --Remove useless import, automatically add @ Deprecated and @ Override


In particular, if you add @ Override automatically, you can clearly understand that those functions are inherited.

Code prompt

The code prompt function of visual Development X must be very systematic. I am a person who cannot Coding without code prompts. Click Windows-Preference in the menu and switch to the following window.

Find Auto Activation, that is, the section in the red boxAuto activation delay (MS ):Change50

SetAuto activation triggers for Java:Change. AbcdefghigklmnoprstuvwxyzIn this way, you can prompt at any time.

 

The last two tools are introduced,Search EverythingQuickly search for a file based on the file name,ClipXClipboard history.

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.