Tips for Using Eclipse

by Virginia Campbell

1. Alt + ? or Alt + /: Auto-Complete Code or Prompt Code

This is the most useful shortcut key combination. After entering a few characters of “syso”, just press the two keys, and eclipse will automatically complete System.out. println ();. And eclipse appears “.” by default for prompt. If the middle prompt is broken and you want to look at it again, you have to re-enter “.” in front of the corresponding class or variable. Only then can you see the prompt again. The combination of these two keys can also serve as a prompt. You can give it a try. Moreover, if there are local variables that need to be traversed after inputting “for”, it will pop up to select for each traversal or for (int;;) or while(), and then generate code automatically.

2. Ctrl + O: Quick outline view.

If you want to view the methods of the current class or a specific method, but don't want to pull up and down the code, and don't want to use the search function, use Ctrl + o. Especially when you directly open or track a class with many methods, this shortcut key is very useful. Those methods and member variables are clear to see. It lists all methods and properties in the current class. All you need to do is enter the name of the method you want to query and click “Enter” to jump directly to the location you want.

This is probably the most time-saving of all shortcut key combinations, especially you can find a file directly in the project or workspace by name. This set of shortcut keys allows you to open any file in the workspace. You just need to press the first few letters of the file name or mask name, such as apply *. XML. The fly in the ointment is that this set of shortcut keys cannot be used in all views.

4. Ctrl + Shift + F: Format Code

The default is 80 characters for line wrapping. This can be set. You can also reformat the code according to the code style settings. Some teams have a uniform code format. They put it on the wiki. Open Eclipse, select WindowStyle, and then set CodeFormatter, CodeStyle, and OrganizeImports. Use the Export function to generate the configuration file. Then everyone in the team imports into their own Eclipse.

5. Ctrl + E: Quick Conversion Editor

This set of shortcut keys will help you browse between open editors. When many files are open, Ctrl + e will be more efficient.

6. Ctrl + Page Down or Ctrl + Page up: Quick Switching Between Tabs

You can browse the front and back tabs. If you are skilled in using it, each page will switch quickly.

7. Shift + Enter and Ctrl + Shift + Enter: to Create a Blank Above or Below the Current Line

Shift + Enter creates a blank line below the current line, regardless of whether the cursor is at the end of the line. Ctrl + Shift + Enter inserts a blank row before the current row. These two shortcut keys are helpful. At first, you may strange to it, but after using it many times, you will feel convenient.

 

Leave a Comment