Eclipse editor Basic settings, Eclipse editor settings

Source: Internet
Author: User

Eclipse editor Basic settings, Eclipse editor settings
1. Add a row number

 

Right-click the edge

 

2. Change the font

 

 

 

 

 

General font configuration

 

 

3. check spelling errors

 

 

4. Java code style

 

Code formatting

 

Ctrl + Shift + F

 

 

 

Click the New button on the right to create a New style.

 

 

 

Click OK

 

 

Braces curly Braces selected

 

Then, when editing other styles, click the Edit button in the previous menu.

 

 

 

5. Content auxiliary settings

 

 

 

6. Add, select, and compile JDK settings

 

Add JDK

 

 

 

 

 

 

 

Click Add on the right

 

 

 

 

 

Compilation settings

 

 

 

 

 

 

 

7. Modify smart prompt options

 

 

 

 

 

 

Indicates hitting. And entering @ will prompt

 

 

Configure the shortcut key Content Assist

 

 

Settings below

 

 

 

 

 

8. Enhanced Eclipse (MyEclipse) input code prompt function 8.1, general settings

(1) Open Eclipse and select "Window -- Preferences ".

(2) Select "Java -- Editor -- Content Assist" in the directory tree, and find the "Auto Activation triggers for java" option on the right side of "Auto-Activation. The "." symbol is triggered by default.

(3) In the "Auto Activation triggers for java" option, add the letter. abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ after. Then "Apply" and click "OK ".

(4) Select "File -- Export", select "General -- Perferences" in the pop-up window, and click "Next ".

(5) Select "Export all", specify the Save path, and click "Finish" to generate the "*. epf" file.

(6 ). edit "*. epf "file: Search ". abc ", and then put ". abc "changed :. abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ (, @, and then save "*. epf file.

(7) Select "File -- Import", select "General -- Perferences" in the pop-up window, and click "Next ".

(8) Select the "*. epf" file, select "Import all", and click "Finish" to complete the operation.

At this time, Eclipse can trigger code prompts Based on the edited English letters (uppercase or lowercase) and carry the input, which is convenient and convenient.

 

When setting the prompt for editing each file, it is window à Preferences and then searches for content Assist.

 

 

 

 

However, it is slightly different when you set an editor.

 

Take Java and XML as an Example

 

Java

 

 

 

XML

 

 

8.2. Questions about modifying spaces and "=" automatic screen Loading

Previously, I only knew alt +/to call up assist. Later I found that content assist can be activated for all letters (written in 8.1 ). It is really nice to use, but some default settings in eclipse are not very good. For example, the Space key and the = sign will automatically display the content of the first line, in fact, many times I just want to enter a space or a = sign. This cannot be set in the settings. Fortunately, eclipse has a plug-in mechanism. You can modify the plug-in source code, export it as a plug-in, and replace the original plug-in for processing.

1. First find the relevant plug-in

Open Plug-ins View and find the Plug-in org. eclipse. jface. text. Right-click and choose import as Source Project. After the import is complete, you can see the project in your workspace.

2. modify the code

In the src/org/eclipse/jface/text/contentassist/CompletionProposalPopup. java file, find the line of code

Char [] triggers = t. getTriggerCharacter ();

If (contains (triggers, key ))

In the line if judgment, eclipse will determine whether the key (that is, the key you press) is in triggers. if so, it will trigger the code of the first line prompting the screen, so what we need to do is to exclude space and =:

If (key! = '& Key! = 0x20 & contains (triggers, key ))

 

3. Export the modified org. eclipse. jface. text.

Right-click org. eclipse. jface. text, select export --> Deployable plugins and fragments, next, destination select archive file, and then finish. you can see the generated jar in the zip file and use it to replace the jar package with the same name in eclipse/plugins.

 

If (key! = 0x20 & key! = '& Key! = ';' & Contains (triggers, key ))

Finally, Export the modified plug-in. Right-click the project in your workspace, select Export-> Deployable plugins and fragments, click Next, select the Destination tab, and select Directory, select a directory to save the plug-in, and then Finish. Then a new plugins directory will be generated under the directory you selected, which contains a jar file that replaces org in eclipse/plugins. eclipse. jface. text_3.6.1.r361_v20100825-0800.jar (this file different versions of Eclipse, the later version will be different, I use Eclipse 3.6), so it is done!

 

 

9. Import JUnit

Right-click the project and choose Build Path à Add Libraries.

 

 

 

 

 

 

10. modify code 10.1 and project code

Right-click the project and choose Porperties

Select Resource select UTF-8

 

10.2. encoding-related settings in MyEclipse8.0

10.2.1 Window> Preferences> General> Editors> Text Editors> Spelling

The settings here are generally related to the text displayed in the editor of the Code. garbled characters may occur when the settings are incorrect.

Then manually enter GB18030

10.2.2. Set Run Configuration and Debug Configuration

 

Http://www.cnblogs.com/decarl/archive/2012/01/02/2310017.html

 

 

11. Shortcut Keys

 

(1) Ctrl + Space

Description: Content assistant. Provides prompts for methods, variables, parameters, and javadoc, which should be used in various scenarios. In short, you can press this shortcut key when prompted. Note: do not conflict with the input method switching settings.

(2) Ctrl + Shift + Space

Note: Variable prompt

(3) Ctrl +/

Note: Add/Remove // comment. In eclipse2.0, the Comment for elimination is Ctrl + \

(4) Ctrl + Shift +/

Note: Add/**/comment

(5) Ctrl + Shift + \

Note: delete/**/comment

(6) Ctrl + Shift + F

Note: The code is automatically formatted.

(7) Ctrl + 1

Note: you can modify variable names in source code in batches and use them on catch blocks.

(8) Ctril + F6

Note: interface switching

(9) Ctril + Shift + M

Note: Find the desired package

(10) Ctril + Shift + O

Note: The required package is automatically introduced.

(11) Ctrl + Alt + S

Note: Quick menu for source code. Generate getters and setters and Surround with try/catchblock are commonly used. We recommend that you add them as shortcut Keys. The shortcut Keys are set on windows> preferences> Workbench> Keys.

 

2. Shortcut Key List

Edit

Shortcut for scope Function

Delete a row Ctrl + D

Globally search and replace Ctrl + F

Search for the previous Ctrl + Shift + K in the text editor

Search for the Next Ctrl + K in the text editor

Globally undo Ctrl + Z

Global copy Ctrl + C

Select Alt + Shift + continue for global recovery.

Globally cut Ctrl + X

Global quick correction Ctrl1 + 1

Global content assist Alt +/

Globally select Ctrl +

Delete globally

Global context information Alt +? Alt + Shift +? Ctrl + Shift + Space

Java editor display tooltip description F2

Java editor selects the encapsulation element Alt + Shift + Transform

Java editor selects the previous element Alt + Shift + ↓

Select the next element Alt + Shift + →

Text Editor incremental search Ctrl + J

Text Editor incremental reverse lookup Ctrl + Shift + J

Globally paste Ctrl + V

Global redo Ctrl + Y

 

View

Shortcut for scope Function

Zoom in globally Ctrl + =

Ctrl +-

 

Window

Shortcut for scope Function

Global activation editor F12

Global switch editor Ctrl + Shift + W

Global editor Ctrl + Shift + F6

Global View Ctrl + Shift + F7

Global Perspective Ctrl + Shift + F8

The next global editor Ctrl + F6

Next Global View Ctrl + F7

Ctrl + F8

Text Editor display ruler context menu Ctrl + W

Global View menu Ctrl + F10

Global display of System Menu Alt +-

 

Navigation

Shortcut for scope Function

Open the structure Ctrl + F3 in the Java editor.

Global Open type Ctrl + Shift + T

Global Open Type hierarchy F4

Global open declaration F3

Open external javadoc Shift + F2 globally

Globally open resource Ctrl + Shift + R

Global rollback history Alt + rollback

Global forward history Alt + →

Ctrl +,

Ctrl +.

Java editor display outline Ctrl + O

Globally open the type Ctrl + Shift + H in the hierarchy

Globally move to matching parentheses Ctrl + Shift + P

Go global to the previous editing location Ctrl + Q

Go to the previous Member Ctrl + Shift + ← in the Java editor.

Go to the next member in the Java editor Ctrl + Shift + ←

Text Editor to Ctrl + L

 

Search

Shortcut for scope Function

Globally displayed in the file Ctrl + Shift + U

Global Search dialog box Ctrl + H

Declare Ctrl + G in the global Workspace

Reference Ctrl + Shift + G in the global Workspace

 

Text editing

Shortcut for scope Function

Text Editor rewrite switch Insert

Ctrl + ← on the text editor

Ctrl + ←

 

File

Shortcut for scope Function

Save Ctrl + X Ctrl + S globally

Print Ctrl + P globally

Globally Disable Ctrl + F4

Globally save Ctrl + Shift + S

Globally Disable Ctrl + Shift + F4

Global attribute Alt + Enter

Globally create Ctrl + N

 

 

Project

Shortcut for scope Function

Global build Ctrl + B

 

Source code

Shortcut for scope Function

Java editor format Ctrl + Shift + F

Java editor uncomment Ctrl + \

Java editor comment Ctrl +/

Add and import Ctrl + Shift + M to the Java Editor

Java editor organization import Ctrl + Shift + O

The Java editor uses try/catch blocks to enclose unset ones, which is too common. Therefore, we recommend that you set them here. You can also use Ctrl + 1 for automatic correction.

 

Run

Shortcut for scope Function

F7 is returned in one global step.

Skip F6 in one global step

Global One-Step Jump to F5

Global One-Step Jump-in and select Ctrl + F5

Global debugging last started F11

Continue F8 globally

Shift + F5 in one step using filters globally

Globally Add/remove breakpoints Ctrl + Shift + B

Global display Ctrl + D

Global run last started Ctrl + F11

Run Ctrl + R globally

Globally execute Ctrl + U refactoring scope function shortcut key

Global undo reconstruction Alt + Shift + Z

Global extraction method Alt + Shift + M

Global extraction of local variables Alt + Shift + L

Global inline Alt + Shift + I

Move Alt + Shift + V globally

Globally rename Alt + Shift + R

Global redo Alt + Shift + Y

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.