IDEA common configuration and common plug-ins

I use IntelliJ IDEA for almost two years, think it is very easy to use. Summary In the course of the individual's IDEA common configuration and common plug-ins, that this configuration is conducive to improve development efficiency, and would like to share to you

Note: IDEA version of this blog are using the 2018, different versions of the IDEA may be some differences

Common arrangement

Configuring JDK

In the IDEA start page, drop-down Configure, choose Project Defaults - Project Structure, so you can set the default JDK versions of all items, as shown below

Configuring JDK

file encoding

file encoding

Files and code templates

Files and code templates

Maven configuration

Maven configuration

Auto Import dependent Maven

Automatically import Maven projects

Java code for single-line comments to add a space

Here Insert Picture Description

Import and intelligent optimization depend remove extraneous

Import and intelligent optimization depend remove extraneous

Modify Subject

Modify Subject

Change font

Change font

Code hints are not case sensitive

Code hints are not case sensitive

The method of the number of lines and line

The method of the number of lines and line

Directory display settings

Directory display

Open IDEA project selection

Open IDEA project selection

Code automatically prompt shortcuts

Remove occupied shortcut Alt + slash

Remove occupied shortcut Alt + slash

Basic settings shortcut key Alt + slash

Basic settings shortcut key Alt + slash

Global modify the file description information (recommended)

/**
 * Description: 
 *
 * @author JourWon
 * @date ${DATE} ${TIME}
 */

Unified modify the file description information

Modify the description of a single file (not recommended)

Remove

#parse("File Header.java")

Add to

/**
 * Description: 
 *
 * @author JourWon
 * @date ${DATE} ${TIME}
 */

Modify individual file description information

Generation Notes

1. Open the Preferences

2.Editor -> Live Templates -> right click the plus sign to add a Templates Group for yourself -> then select your Group once again Click the plus sign to add Live Templates

Generation Notes 1

3. Then set your favorite shortcuts inside Abbreviation remember Applicable in check inside Java

Note Generation 2

4. Then add parameters and return values ​​in the Edit variables which automatically values

*
 * Description: $Description$
 *
 * @author JourWon
 * @date $DATE$ $TIME$
$param$
 * @return $return$
 */

Note generating method 3

groovyScript脚本

groovyScript("def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {result+=' * @param ' + params[i] + ((i < params.size() - 1) ? '\\n' : '')}; return result", methodParameters())

5. Then the direct input method of the above you/*+*+Tab

Generation of Note

/**
 * Description: $Description$
 * 
 * @author JourWon
 * @date $DATE$ $TIME$
 */

Generation of Note

On the type of input cd+回车or inputcd+Tab

IDEA报错Could not autowire. No beans of ‘xxxxMapper’ type found

解决办法是:降低Autowired检测的级别,将Severity的级别由之前的error改成warning

Reduce the level of detection Autowired

IDEA生成序列号serialVersionUID

设置完成后,按Alt+Enter键,这个时候可以看到"Add serialVersionUID field"提示信息

SEQ ID NO IDEA to generate serialVersionUID

导出导入配置

导出配置

file -> export setting, 设置导出的settings.jar包的位置,然后点击OK

Export Configuration

导入配置

file -> import settings,选择你想要导入的 settings.jar即可

常用插件

  1. Alibaba Java Coding Guidelines -阿里巴巴代码规范检查插件

  2. FindBugs-IDEA -检查潜在bug插件

  3. Free Mybatis plugin -Mybatis 辅助插件

  4. GsonFormat -将JSON字符串转换为内部类实体类插件

  5. Lombok plugin -简化实体类编写插件

  6. Maven Helper -Maven辅助插件

  7. SonarLint -代码质量检查插件

  8. Translation -翻译插件

  9. CodeGlance -代码地图

  10. .ignore -git忽略文件

  11. CamelCase -驼峰式转换插件

  12. String Manipulation -一款强大的字符串转换工具

  13. Key Promoter X -一款可以进行快捷键提示的插件

  14. AceJump -一款可以彻底摆脱鼠标的插件

  15. IDEA查看日志的插件

    ANSI Hignlighter - 高亮插件

    Ideolog – ide查看日志插件

发布了227 篇原创文章 · 获赞 3815 · 访问量 44万+

Guess you like

Origin blog.csdn.net/ThinkWon/article/details/101020481