Myeclipse settings for dark horse programmers

Source: Internet
Author: User
Tags try catch

----------- Android training, Java training, and Java learning technology blog. We look forward to communicating with you! ------------


1. Prompt key Configuration
By default, the code prompt function of eclipse and myeclipse is much worse than that of Microsoft Visual Studio.
, Mainly eclipse. myeclipse has many options that are disabled by default. You need to manually configure them by yourself. If development
If you do not know, you do not know eclipse. The code prompt function of myeclipse is similar to that of Microsoft Visual Studio.
Code presentation is equally powerful.
First, let's give a simple example to illustrate the problem. For example, in eclipse and myeclipse Code, set a foreach and switch.
You can't get the code prompts (Don't believe it yourself), but you don't need to say anything else, but in Microsoft Visual
Studio receives friendly code prompts. In fact, the code prompt function in eclipse and myeclipse code
By default, click ".". Generally, click "." To prompt the code.
Principle: The "Auto activation triggers for Java" option refers to the option that triggers the code prompt.
Change ". abcdefghijklmnopqrstuvwxyz (," to indicate that 26 letters and.
Code presentation function. Enhance the code prompt function of eclipse and myeclipse. How can I configure it?
The procedure is as follows:
1. Open myeclipse, and then "window" → "Preferences"
2. Select "Java", expand, "Editor", and select "content assist ".
3. Select "content assist" and then see "Auto" under "auto-activation" on the right.
Activation triggers for Java "option. Actually, the code prompt is triggered by the "." symbol.
4. The "Auto activation triggers for Java" option should be followed by an ABC letter after "." To facilitate later search and modification. Then, "Apply" and click "OK ".
5. Select any project "file"> "Export", select "perferences" in the pop-up window, and click "Next ".
6. Select the export file path, export it to the desktop, enter "test" as the file name, and click "save ".
7. Find the file "test. EPF" you just saved on the desktop, right-click and choose "open with Notepad ".
8. You can see a lot of information about configuring myeclipse.
9. Press the "Ctrl + F" shortcut key, enter ". ABC", and click "find next ".
10. Find the configuration information of ". ABC.
11. Change ". ABC" to ". abcdefghijklmnopqrstuvwxyz (,". Save and disable "test. EPF ".
12. Go back to the myeclipse interface, "file" → "import", select "perferences" in the pop-up window, and click
Click "Next", select the modified "test. EPF" file, click "open", and click "finish ". This step
It is similar to the preceding export procedure.
13. Finally, of course, the code is tested. Create a project and a class. Enter switch and foreach in the code.
Test. You will immediately find that there are prompts, and there will be many related prompts no matter which letter you typed.
Smooth and convenient.
Conclusion: The "auto activation triggers for Java" option refers to the option that triggers code prompts and changes "."
". Abcdefghijklmnopqrstuvwxyz (," means that the code prompt function is triggered when 26 letters and symbols are met.

Finally, we recommend that you change the pop-up time to less than 100 milliseconds. Otherwise, the pop-up time will only pop up when you are finished.

2. How to Use the shortcut key "system. Out. println ()" in "myeclipse ():

If you do not prompt the command name sysout when printing Sy characters, you can customize the string and command name to be printed. Similar to the key-value option, you can choose windows> preferences> JAVA> editor> templates> New to customize the key-value option.

3. Prompt shortcut key settings:

Open Window-> preference-> Generate-> keys, and a large dialog box is displayed. The command name "Alt +/" corresponds to "content assist". Find this command, click to select it. At this time, the binding and when in the window will automatically display the Command Information, delete the information in the binding, and then press the keyboard Alt + /, at this time, the binding will automatically display the Alt +/shortcut key, then select editing Java source in the when window, and click OK.

4. Background:

Window -- preference -- Java -- editor-completion proposals background color 205

5. Configure different colors for keywords
Modify the class name and interface name highlighted in different colors.
1. Open myeclipse, and then "window" → "Preferences ".
2. You can configure "Java"> "enditor"> "syntax coloring" in this way ".
3. Expand "Java"> "classes" on the right side, check the "enable" option, and select your preferred color.
Of course there are other related color configurations. In fact, there are many configuration items in the "Preferences ",
If myeclipse is optimized, You need to configure it according to your personal preferences.
6. Adjust the display size of codes in myeclipse
Window-> preferences-> General-> apperance-> colors and fonts-> basic-> text-> Fonts

Click Change!

7. Set the background color of the myeclipse editing window

In the editing window, right-click --> preferences --> General plus sign --> editors plus sign --> text editors. In the lower-right window, select backgroud color,
Click the system default button on the right, click the color box on the right, and select the color OK.

8. Common shortcut keys
Eclipse has powerful editing functions, master the eclipse shortcut key function, and greatly improve development efficiency. In eclipse
Shortcut Keys related to editing.
1. [Alt + /]
This shortcut key is a good helper for users to edit and can help users with content. Do not worry about incomplete methods and attribute names,
When you do not remember the names of classes, methods, and attributes, try the benefits of the [Alt +/] shortcut key.
2. [Ctrl + O]
Display the class method and attribute outline, and quickly locate class methods and attributes, which are useful in searching for bugs.
3. [Ctrl + /]
Add comments quickly. You can add comments or cancel comments quickly for the row where the cursor is located or the row selected. You may always need
Now you have to comment something or cancel the comment. You do not need to repeat the comment in each line.
4. [Ctrl + D]
Delete the current row, which is one of my favorites. You do not have to press the delete key multiple times to delete a row.
5. [Ctrl + M]
The window is maximized and restored. When you operate in the window, you will always feel that the current window is small (especially when writing code ).
Now, try the [Ctrl + M] shortcut.
View and locate shortcuts
In the program, it is not easy to quickly locate the location of the code and quickly locate the bug. Eclipse provides powerful

You can use the following shortcut keys to complete searching and locating.
1. [Ctrl + k] and [Ctrl + + Shift + k]
You can quickly search for the selected content down and up. You no longer need to click the Search dialog box.
2. [Ctrl + Shift + T]
You can find Java class files in the workspace build path.

Use "*" and "?" .
3. [Ctrl + Shift + R]
Corresponds to Ctrl + Shift + T. You can also find all files (including java files) in the workspace.

Use wildcards.
4. [Ctrl + Shift + G]
Search for reference of classes, methods, and properties. This is a very practical shortcut. For example, to modify the code that references a method, you can

Use the [Ctrl + Shift + G] shortcut to quickly locate all positions that reference this method.
5. [Ctrl + Shift + O]
Quickly generate import. If you copy a program from the Internet and do not know how to import the called class, try [Ctrl + Shift + O

] Shortcut keys, which will certainly surprise you.
6. [Ctrl + Shift + F]
Formatting code and writing standardized code is a required course for every programmer.

Press the CTRL + Shift + F shortcut to format the Code. If no code is selected, the current file is formatted by default.

File ).
7. [Alt + Shift + W]
Find the path in the project where the current file is located, you can quickly locate the location of the browser view, if you want to find the path of a file

This shortcut key is very useful (especially in large projects ).
8. [Ctrl + L]
Locate a line in the current editor, which is also valid for non-java files.
9. [Alt + ↓] and [Alt + →]
The backward and forward history records are very useful in tracking code. You may find several associated areas,

You may not be able to clearly remember. You can use these two shortcut keys to locate the search sequence.
10. [F3]
Quickly locates a class, method, and attribute at the cursor position.
11. [F4]
Display the inheritance relationship of the class and open the class inheritance view.
Debugging shortcuts
Eclipse has the following shortcut keys related to running debugging.
1. [Ctrl + Shift + B]: Set a breakpoint or cancel a breakpoint in the current row.
2. [F11]: debug the program that was last executed.
3. [Ctrl + F11]: run the program that was last executed.
4. [F5]: trace the method. When the program executes a method, press [F5] to track the method.
5. [F6]: One-step execution program.
6. [F7]: After the method is executed, the last statement that calls this method is returned.
7. [F8]: continue to run until the next breakpoint or program ends.
Common editor shortcuts
Generally, the text editor provides editing-related shortcut keys. You can also use these shortcut keys in eclipse for text

1. [Ctrl + C]: Copy.
2. [Ctrl + x]: cut.
3. [Ctrl + V]: paste.
4. CTRL + S: Save the file.
5. [Ctrl + Z]: Undo.
6. [Ctrl + Y]: repeated.
7. [Ctrl + F]: search.
Other shortcuts
There are still many shortcut keys in eclipse that cannot be listed one by one. Users can find their usage methods through the help documentation. In addition

There are several common shortcut keys as follows.
1. [Ctrl + F6]: switch to the next editor.
2. [Ctrl + Shift + F6]: switch to the previous editor.
3. [Ctrl + F7]: switch to the next view.
4. [Ctrl + Shift + F7]: switch to the previous view.
5. [Ctrl + F8]: switch to the next perspective.
6. [Ctrl + Shift + F8]: switch to the previous perspective.
There are many shortcut keys in eclipse. You can find all the shortcut keys in the help document, but you must master the use of all the shortcut keys.

It is impossible and unnecessary. If you spend some time getting familiar with the shortcut keys listed in this section, you will get twice the result with half the effort.
1. Edit-> content assist-> Add Alt +/code Association
2. Window-> next editor-> Add Ctrl + TAB to switch the window
3. Run/debug toggle line breakpoint-> Add Ctrl + 'add or delete breakpoints during debugging
4. Source-> surround with try/Catch Block-> Ctrl + Shift + V add try catch box
5. Source-> Generate getters and setters-> Ctrl + Shift +. added the get set method.
----------- Useful shortcuts -----------
Alt +/code assistant inserts some code (but it is usually in conflict with the input method, you can modify the Input key, or temporarily use

Alt +/to replace)
CTRL + 1: move the cursor over a variable and press Ctrl + 1 to provide a quick refactoring solution. Select several rows and press Ctrl + 1

Put the code in the for, while, if, do, or try code blocks.
Double-click the left brackets (parentheses, braces, and braces) to select all the content in the brackets.
Alt + enter display the properties of the currently selected resource (project, or file)
----------- CTRL series -----------
CTRL + K: move the cursor over the variable. Press Ctrl + k to find the next variable.
CTRL + Shift + K: the opposite direction of Ctrl + k search
CTRL + E: Click it to quickly display the drop-down list of the current editer (if the current page is not displayed, it is displayed in bold)
CTRL + Shift + e display the managers that manage all Opened Views (you can choose to close or activate them)
CTRL + q locate the Last edited location
CTRL + l locate in a line (for those with more than 100 programs, there will be good news)
CTRL + M maximize the current edit or view (then press it, and vice versa)
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 + shift-T: Open type ). If you do not intend to sharpen the work, or forget to use the source

CTRL + O: open a small window similar to the Outline View in the code
CTRL + mouse stop: displays the source code of the class and Method
CTRL + H: Open the search window
CTRL +/(keypad) collapse all code in the current class
CTRL + × (keypad) show all the code in the current class
----------- Ctrl + shift series -----------
CTRL + Shift + F format the current Code
CTRL + Shift + x change all selected text to lowercase
CTRL + Shift + y change all selected text to lowercase

CTRL + Shift + O: Fast Import

CTRL + Shift + R: Open resource open Resource

CTRL + Shift +/Add segment comments /**/
CTRL + Shift + \ cancel segment comments /**/

Shift + ALT + JT write document comments for methods
----------- F shortcut series -----------
F3: open the file that declares the reference.
F4: Open the type hierarchy
F5: One-Step Jump
F6: Skip in one step
F7: One-Step Jump out
F8: continue. If there is no breakpoint at the end, the program will be running
----------- Use --------- for row editing -----------
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)
Shift + enter insert empty rows in the next row of the current row (the mouse can be at any position of the current row, not necessarily the last row)
CTRL + Shift + enter insert blank lines in the current line (same principle)
----------- Not commonly used -----------
Alt + ↓ previous edited page
Alt + → next edited page (of course for the above)
CTRL + Shift + S: Save all
CTRL + W disable the current editer
CTRL + Shift + F4 close all open editer
CTRL + Shift + G: Search for references in Workspace
CTRL + Shift + P locate the matched character (for example, {}) (when positioning from the front, the cursor must be inside the matched character, followed by the front,

----------- Do not understand -----------
CTRL + J forward incremental search (after pressing CTRL + J, each letter editor you enter provides a quick match to locate a word, such

If no, it is not found in stutes line. It is particularly useful when querying a word. This feature was available two years ago)
CTRL + Shift + J reverse incremental search (the same as the previous one, but only from the back to the front)

----------------------- Android training, Java training, Java learning technology blog, hope to communicate with you! ----------------------


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