| author: jiangxia

| CSDN:blog.csdn.net/qq_41153943

| the nuggets: juejin. Cn/user / 651387…

| zhihu: www.zhihu.com/people/1024…

| GitHub:github.com/JiangXia-10…

This article is about 2165 words. It is recommended to read for 15 minutes

This is the 13th day of my participation in the August More Text Challenge. For details, see:August is more challenging

1, the preface

IntelliJ IDEA (IDEA for short) is an integrated environment for Java language development. IDEA is recognized as one of the best Java development tools in the industry. Especially in the intelligent code assistant, code auto-prompt, refactoring, J2EE support, various version tools (Git, SVN, GitHub, etc.), JUnit, CVS integration, code analysis and innovative GUI design and other aspects of the function are excellent, is currently one of the most widely used development tools. Our company uses IDEA for project development. Idea has many configurations, which can improve our development efficiency and work efficiency greatly. Here I will summarize the detailed configuration of my IDEA and record my own experience. Of course, it would be better if I could help you quickly get started and master the idea on this basis

Here for the installation of idea is not introduced, idea download can go to the official website, official website address, free version can download the community version, professional version needs to charge, there are also some PJ methods online, you can refer to reference, suggest conditional or to support the legal version. In addition, the version of IntelliJ IDEA I used is 2018.1 version, and most functions should be similar. Because I have been used for a long time, I have been used to it, so I did not upgrade the latest version.

2. IDEA usage Settings

After installing IDEA, open IDEA, and then set idea. IDEA has two kinds of Settings: global configuration and project configuration. Settings in the welcome page is to set the global configuration. In the project setting is the setting of the current project.

2.1 Global JDK Settings (default)

1.File–>Ohter Settings–>Default Project Structure

2. Select an installation path and configure it

Note: To change any configuration, click Apply and then Ok for the configuration to take effect!

2.2 Theme style Settings

2.2.1 Theme setting

Theme You can select your favorite theme when installing IDEA, but you can change it later:

File – – > Settings – > Appearance&Behavior – > Appearance > UI Options — – > the Theme:

Idea default theme on the above several more themes, you can go to the idea theme download, download will have jar package, then in File–>Import Settings select your favorite theme jar package, and then according to the above steps to select.

2.2.2 Font style Settings

2.2.2.1 Setting UI styles and fonts for non-code Windows:

File – – > Settings – > Appearance&Behavior – > Appearance – > the UI Options:

2.2.2.2 Font in code window

File–>settings–>Editor–>Font:

2.2.2.3 Fonts in the console window

The Console Font is set in the same way as the Editor Font, but the setting path is different. The Console window is set in: File–> Settings –>Editor–>Color Scheme–>Console Font

2.2.3 Setting the background color of editor

If you want to change the theme of the edit page, you can go to Settings and adjust the background color. The setting method is as follows:

2.3. Set the encoding format of character set and configuration file

File–>settings–>Editor–>File Encodings:

2.4 Setting mouse hover prompt

Set path: File — > Settings — >Editor — >General — > select Show quick Documentation.

2.5 Setting to Ignore case prompts

The default setting of IDEA is case-sensitive prompt, so when the case of the input field is inconsistent, code prompt will not be provided. For example, if the input is String, it will not prompt String, which is not convenient for coding, so you can set case-insensitive prompt.

Path: File –> Settings –> Editor –> General–>Code Completion:

2.6 Configuring automatic import

File–>Settings–>Editor–>General–>Auto Import”

2.7 Disabling automatic Update

Idea version release is still very fast, so every time there is a new version release IDEA will prompt update, if you do not want to update so each prompt is very troublesome, so you can set off automatic update.

Set path: File–>Settings–>Appearance–>Behavior–>System Settings

2.8 Set the closing project as the last closing project

Set path: File–>Settings–>Appearance –> Behavior–> System Settings”

2.9 Setting the dividing line between display methods

Sometimes there are too many methods to look at the code, so you can set the dividing line between methods.

File–>Settings–>Editor–>General–>Appearance

Display effect:

If not set, there is no dividing line

2.10 Setting the Tab page to Display multiple lines

Idea open code, the default is to show a line, beyond the hidden, sometimes not good to view the code, the default effect:

Tab page displays the setting path in multiple lines: File–>Settings–>Editor–>General–>Editor Tabs

You can set TAB page to display multiple lines, so that more intuitive, display effect:

2.11 Shortcut Key Configuration

Idea set some habits of shortcut keys can greatly improve the efficiency of peacetime development.

Set path: File–>Settings–>Keymap

2.12 Enabling automatic Code compilation

Set the path: File – > Settings – > Build, Execution, Deployment – > Compiler

2.13 Setting Horizontal or Vertical Display of Codes (Code Alignment)

Used to other editors can be found, but we need to do code comparison only need to drag TAB pages, such as Eclipse, VS, etc., but idea drag is not effective, here you need to set

Setting Method Right-click a TAB

Effect:

2.14 Viewing the Local Code History

There are times when you need to view the history of code changes. In this case, right-click the code file you want to view and select Local History –> Show History

Effect:

2.15 setup Maven

Set path: File–>Settings–>Build, Execution, Deployment–>Build Tools–>Maven

The settings. XML path I set here is the aliyun image, the download speed is relatively fast.

  <mirrors>
     <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
  </mirrors>
Copy the code

2.16 Setting the Comment Template to be Automatically generated

In the process of code development, it is necessary to develop a good habit of code comment, but writing comments is time-consuming, so idea can set the comment template:

2.16.1 Setting comment Information for Creating a Class

Path: File -> Settings -> File and Code Templates -> Includes -> File Header

Template:

 * @Auther: ${USER}
 * @Date: ${YEAR}/${MONTH}/${DAY}/${TIME}
 * @Description: 
 */
Copy the code

2.16.2 Comment information about the Setting method

Go to File -> Settings -> Live Templates

Create a group first:

Create template:

Template:

* @Description: $description$
* @Param: $params$
* @return: $returns$
* @Author: $user$
* @Date: $date$
*/
Copy the code

3 summary

The above is the specific configuration used in the development process of my IDEA, which is not necessarily suitable for everyone, there is no best setting, only the appropriate setting, so you can refer to the need, so that you can have a comprehensive understanding of the IDEA!

Any questions or incorrect places are welcome to discuss and correct!

Today’s recommendation

Don’t you know what a database index is

The interview topic series of String and Stringbuffer, the difference between the StringBuilder (source code analysis)

Do you know why the String class cannot be inherited?

SpringBoot integration Druid configuration data source monitoring

Spring Annotations (5) : Four ways for the container to register components