Login With Github

My 9 Common IDEA Configurations For Daily Development

I have been using IDEA for a long time, and my colleagues and friends also start to switch from Eclipse to IDEA. In fact, both Eclipse and IntelliJ IDEA are development tools, and each has its own advantages. You'll feel uncomfortable when switching from Eclipse to IDEA, so some people may switch back to Eclipse after using it for a while. Today I'll introduce some of my IDEA's daily configurations from my own experience.

Other Settings

You cannot open multiple projects in one window in IDEA like in Eclipse. IDEA will open a new window or overwrite the current window every time you open a new project, so you need to open multiple windows when opening multiple projects. And if you don't set Other Settings, you will have to set it each time you open a new window. For example, you'll need to reset maven local repository address each time a new project is opened. This type of problem can be solved by setting Other Settings: File-->Other Settings-->Preferences for New Projects. Search for maven in the search box in the upper left corner, and you will see the configurations shown below.

You can use the similar approach to open the JDK for the project: File-->Other Settings-->Structure for New Projects. Then you can see the Project Settings and Platform Settings.

Compiler

You need to open Compiler in IDEA manually: File-->settings-->Build, Execution, Deployment-->Compiler. Then turn on the option inside the red box below.

Auto Import

By default, IDEA does not enable Auto Import. You need to open it manually: File-->Settings-->Editor-->General-->Auto Import. Then turn on the options in the positions 1 and 2 in the figure below.

After checking the box in the position 1, when we are writing code, IDEA will optimize the imported package automatically, such as removing some unused packages automatically.

After checking the box in the position 2, IDEA will import automatically the package we need when we are writing code. However, for those packages with the same name, you still need to import them manually through Alt + Enter. IntelliJ IDEA is not yet smart enough to judge it for us.

Show Memory indicator

Since we develop on the office computers of the company, we always feel that the memory is not enough. However we don't know how much memory IDEA takes up in real-time. Thus it is better to see real-time memory usage for those developers who feel there is not enough memory. IDEA provides this feature, but it needs to be enabled manually: File-->Settings-->Apperance-->Window Options-->Show Memory indicator.

After checking the box, you can see the real-time memory usage in the lower right corner of IDEA, as shown below:

Hover Prompt

Sometimes when we're looking at the code, we will click into the comments of classes if we don't know what the classes are for. But the powerful IDEA supports checking the information associated with the comments and classes without clicking into them. You need to open it manually as well: File-->Settings-->Editor-->General. Then check the box shown in the figure below, and the time followed is the display time of the Hover Prompt.

The effect is as follows:

Change font size with Ctrl+Mouse Wheel

IDEA also supports changing the font size of the editing area by holding down Ctrl+mouse wheel, which is like in a browser: File-->Settings-->Editor-->General.

Check the box shown in the figure below.

The effect is as follows:

Display Multiple Lines of Tab

When we open more tabs, they will be hidden on the right side by default. And when we need a certain tab, we have to find it on the right side. IDEA supports multi-line display, so you don't have to click on the right side to look for the file you just opened on the big screen (In fact, you can also find the file you just opened through Ctril+E.): File-->Settings-->Editor-->General-->Editor Tabs.

Just uncheck the box in the position 1. And in the position 2, you can set the maximum number of tabs which can be displayed.

Show Line Numbers And The Recent svn/git Commiter

If you operate on the editing area directly, you can see the one who modified each line of code last and the commit information. There are records for each line of code. So you can quickly locate who modified the code and then find the specified person to solve the problem.

View the Local History of a File

Select the file with the mouse, then right-click, and select Local History in the pop-up list. And then you can see the local modification records of the file, even if there is no version control tool.

Summary

These are just the habits that I summarize personally, so they vary from person to person. If you have any ideas about the configuration, feel free to discuss it here.

0 Comment

temp