JetBrains IntelliJ IDEA 优化教超详细程
本教程基于JetBrainsIntelliJIDEA2020.3.2编写。
JetBrainsIntelliJIDEA下载地址:JetBrainsIntelliJIDEA官网
软件安装完成后,先修改配置文件存放路径,修改配置文件路径后,会导致之前的配置因误操作失效,所以建议先修改在配置。
- 进入IDEA安装位置的bin目录;
- 找到idea.properties文件,编辑这个文件;
#--------------------------------------------------------------------- #UncommentthisoptionifyouwanttocustomizepathtoIDEconfigfolder.Makesureyou'reusingforwardslashes. #--------------------------------------------------------------------- #idea.config.path=${user.home}/.IntelliJIdea/config idea.config.path=D:/Tools/JetBrains/IntelliJIDEA2020.3.2/config #--------------------------------------------------------------------- #UncommentthisoptionifyouwanttocustomizepathtoIDEsystemfolder.Makesureyou'reusingforwardslashes. #--------------------------------------------------------------------- #idea.system.path=${user.home}/.IntelliJIdea/system idea.system.path=D:/Tools/JetBrains/IntelliJIDEA2020.3.2/system
JetBrainsIntelliJIDEA2020.3.X安装文件:
https://www.nhooo.com/article/196349.htm
JetBrainsIntelliJIDEA优化教程
JetBrainsIntelliJIDEA分为两个版本:旗舰版(Ultimate)和社区版(Community)。旗舰版收费(30天免费使用时间,功能齐全);社区版(永久免费,功能简陋)。
1.目录结构解释
bin:容器,执行文件和启动参数等
help:快捷键文档和其他帮助文档
jbr:Java运行环境
lib:IDEA依赖的类库
license:各个插件许可
plugins:插件
其中:bin目录下:
以我的电脑系统(64位windows10,16G内存)为例,说明一下如何调整VM配置文件:
-Xms128m -Xmx750m -XX:ReservedCodeCacheSize=512m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:CICompilerCount=2 -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -ea -Dsun.io.useCanonCaches=false -Djdk.http.auth.tunneling.disabledSchemes="" -Djdk.attach.allowAttachSelf=true -Djdk.module.illegalAccess.silent=true -Dkotlinx.coroutines.debug=off
大家根据电脑系统的位数,选择32位的VM配置文件或者64位的VM配置文件。
32位操作系统内存不会超过4G,所以没有多大空间可以调整,建议不用调整了。
64位操作系统中8G内存以下的机子或是静态页面开发者是无需修改的。
64位操作系统且内存大于8G的,如果你是开发大型项目、Java项目或是Android项目,建议进行修改,常修改的就是下面3个参数:
1-16G | 16G以上 | |
---|---|---|
-Xms | 128m | 512m |
-Xmx | 750m | 1500m |
-XX:ReservedCodeCacheSize | 240m | 500m |
2.设置显示常见的视图
3.设置主题
4.设置窗体及菜单的字体及字体大小
5.设置默认项目路径&打开新项目方式
6.设置适合自己的快捷键风格
7.设置鼠标滚轮修改字体大小
勾选此设置后,增加Ctrl+鼠标滚轮快捷键来控制代码字体大小显示。
8.设置自动导包功能
Addunambiguousimportsonthefly:自动导入不明确的结构
Optimizeimportsonthefly:自动帮我们优化导入的包
9.设置显示行号和方法间的分隔符
Showlinenumbers:显示行数。我建议一般这个要勾选上。
Showmethodseparators:显示方法分隔线。这种线有助于我们区分开方法,所以建议勾选上。
10.忽略大小写提示
11.设置取消单行显示tabs的操作
12.设置默认的字体、字体大小、字体行间距
13.修改当前主题的字体、字体大小、字体行间距
14.修改当前主题的控制台输出的字体及字体大小
15.修改代码中注释的字体颜色
DocComment–Text:修改文档注释的字体颜色
Blockcomment:修改多行注释的字体颜色
Linecomment:修改当行注释的字体颜色
16.设置超过指定import个数,改为*
17.修改类头的文档注释信息
/** ** *
* *@author:bood *@date:${DATE} */
18.添加类、方法注释
类注释: /** ** *
* *@author:bood *@date:$date$ */
方法注释: /** ** *
* *@return:$return$ $params$ *@author:bood *@date:$date$ */
关键字表达式: date date() return methodReturnType() params groovyScript("if(\"${_1}\".length()==2){return'';}else{defresult='';defparams=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]','').split(',').toList();for(i=0;i19.设置项目文件编码
20.设置自动编译
21.Debug的设置
设置Debug连接方式,默认是Socket。Sharedmemory是Windows特有的一个属性,一般在Windows系统下建议使用此设置,内存占用相对较少。 常用断点调试快捷键
22.Maven的配置
Maven的下载–解压–环境变量的配置这里就赘述了。下面直接整合Maven。选择自己Maven的目录,和settings文件,然后配置自己的仓库reposiroty。
Mavenhomepath:可以指定本地Maven的安装目录所在,因为我已经配置了MAVEN_HOME系统参数,所以直接这样配置IntelliJIDEA是可以找到的。但是假如你没有配置的话,这里可以选择你的Maven安装目录。此外,这里不建议使用IDEA默认的。 Usersettingsfile/Localrepository:我们还可以指定Maven的settings.xml位置和本地仓库位置。
23.取消更新
24.过滤文件及文件夹
建议添加如下忽略: *.iml *.idea *.gitignore *.sh *.classpath *.project *.settings25.使用Alt+Insert,生成serialVersionUID
搜索:Serializationissues
26.消除IDEA常见警告
代码中大量的波浪线
搜索:General
SpringAutowriting警告 JetBrainsIntelliJIDEA必备插件
Lombok(新版本中已内置):开发神器,可以简化你的实体类。
GenerateAllSetter:只要你选中需要生成set,get方法的对象,按下快捷键alt+enter,自动生成set,get方法。
mybatis-log-plugin:从控制台提取一个的输出sql语句。
FreeMybatisplugin:FreeMybatisplugin非常方便进行Mapper接口和XML文件之间跳转。
RestfulToolkit:RESTful服务开发辅助工具集(安利,可以直接在右侧的RestServices查看,所有项目的restful接口,还可以通过Ctrl\全局搜索)。
EasyCode:支持自定义模板的代码生成插件。
Translation:中英文翻译工具。
JRebelforIntelliJ:热部署插件。
MavenHelper:方便显示maven的依赖树,处理冲突的好帮手。
FindBugs-IDEA:代码审查。
AlibabaJavaCodingGuidelines:阿里的开发设计规范。
到此这篇关于JetBrainsIntelliJIDEA优化教超详细程的文章就介绍到这了,更多相关JetBrainsIDEA优化内容请搜索毛票票以前的文章或继续浏览下面的相关文章希望大家以后多多支持毛票票!
声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:czq8825#qq.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。