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
Article Directory
- Common arrangement
- Configuring JDK
- file encoding
- Files and code templates
- Maven configuration
- Auto Import dependent Maven
- Java code for single-line comments to add a space
- Import and intelligent optimization depend remove extraneous
- Modify Subject
- Change font
- Code hints are not case sensitive
- The method of the number of lines and line
- Directory display settings
- Open IDEA project selection
- Code automatically prompt shortcuts
- Global modify the file description information (recommended)
- Modify the description of a single file (not recommended)
- Generation Notes
- Generation of Note
- IDEA报错Could not autowire. No beans of 'xxxxMapper' type found
- SEQ ID NO IDEA to generate serialVersionUID
- Export Import Configuration
- Common plug-ins
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
file encoding
Files and code templates
Maven configuration
Auto Import dependent Maven
Java code for single-line comments to add a space
Import and intelligent optimization depend remove extraneous
Modify Subject
Change font
Code hints are not case sensitive
The method of the number of lines and line
Directory display settings
Open IDEA project selection
Code automatically prompt shortcuts
Remove occupied shortcut Alt + slash
Basic settings shortcut key Alt + slash
Global modify the file description information (recommended)
/**
* Description:
*
* @author JourWon
* @date ${DATE} ${TIME}
*/
Modify the description of a single file (not recommended)
Remove
#parse("File Header.java")
Add to
/**
* Description:
*
* @author JourWon
* @date ${DATE} ${TIME}
*/
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
3. Then set your favorite shortcuts inside Abbreviation remember Applicable in check inside Java
4. Then add parameters and return values in the Edit variables which automatically values
*
* Description: $Description$
*
* @author JourWon
* @date $DATE$ $TIME$
$param$
* @return $return$
*/
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$
*/
On the type of input cd+回车
or inputcd+Tab
IDEA报错Could not autowire. No beans of ‘xxxxMapper’ type found
解决办法是:降低Autowired检测的级别,将Severity的级别由之前的error改成warning
IDEA生成序列号serialVersionUID
设置完成后,按Alt+Enter键,这个时候可以看到"Add serialVersionUID field"提示信息
导出导入配置
导出配置
file -> export setting, 设置导出的settings.jar包的位置,然后点击OK
导入配置
file -> import settings,选择你想要导入的 settings.jar即可
常用插件
-
Alibaba Java Coding Guidelines -阿里巴巴代码规范检查插件
-
FindBugs-IDEA -检查潜在bug插件
-
Free Mybatis plugin -Mybatis 辅助插件
-
GsonFormat -将JSON字符串转换为内部类实体类插件
-
Lombok plugin -简化实体类编写插件
-
Maven Helper -Maven辅助插件
-
SonarLint -代码质量检查插件
-
Translation -翻译插件
-
CodeGlance -代码地图
-
.ignore -git忽略文件
-
CamelCase -驼峰式转换插件
-
String Manipulation -一款强大的字符串转换工具
-
Key Promoter X -一款可以进行快捷键提示的插件
-
AceJump -一款可以彻底摆脱鼠标的插件
-
IDEA查看日志的插件
ANSI Hignlighter - 高亮插件
Ideolog – ide查看日志插件