Eclipse shortcut key operations and common settings

Source: Internet
Author: User

 

Automatic prompt:The general keyword prompts that the content is like syso, Which is System. out. println (); for Loop, its shortcut key is (Alt + /)

Format code:Sometimes the code is too messy, you can use the shortcut key for formatting (ctrl-shift-f)

Introduce the package code:Can be quickly introduced to the package shortcut key is (Ctrl + Shift + O)

You can use the shortcut key Shift + Alt + S to generate get/set or toString

Line NumbersTo display the row number of the Code, select Window menu --> Preferences --> General --> Editors --> Text Editors --> Show Line Numbers or right-click on the left margin, select "display row number ".

Change font and size:Click Window --> Preferences --> General --> Appearance --> Colors and Fonts. Expand the Java folder, select Java Editor Text Font, and click Edit.

Encoding support:To enable Unicode support, choose Window --> Preferences --> General --> Workspace --> Text file encoding --> UTF-8. This setting is used for the default character set for file encoding, similar to the command line option of the Virtual Machine-Dfile. encoding = UTF-8. Commonly used character sets are Unicode UTF-8, UTF-16 (with BOM ). Other character sets are US-ASCII and ISO-8859-1.

Compare two files:In the project package resource, right-click two files (Press Ctrl) and choose --> Compare

Useful Eclipse shortcut excerpt:

F3: Go to the declaration of the selected variable/method.

CTRL-SHIFT-G: searches for all references to highlighted variables/methods in the workspace.

ALT-Shift-R: to quickly open a file

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 + Enter display the properties of the currently selected resource (project, or file)

Ctrl + Q locate the Last edited location

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

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 files being edited (if the current page is not displayed, the drop-down list is in bold)

Universal repair shortcuts:Ctrl + 1 sometimes the code will prompt an error .. it may be that the package is not cited or it may be another problem. You can use this shortcut key to see the problem and fix it.

Sometimes you want to put a piece of code into the for loop. if statements in the while LOOP, you can use Shift + Alt + Z to catch exceptions.

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.