IDEA工具设置大揭秘:提升你的开发效率
IDEA工具设置大揭秘:提升你的开发效率
Valyn前言
IDEA设置
开发设置
JDK相关设置
项目的JDK设置
1 | File-->Project Structure...-->Platform Settings -->SDKs |
- 注1:SDKs全称是Software Development Kit ,这里一定是选择JDK的安装根目录,不是JRE的目录。
- 注2:这里还可以从本地添加多个JDK。使用“+”即可实现。
out目录和编译版本
1 | File-->Project Structure...-->Project Settings -->Project |
详细设置
如何打开详细配置界面
显示工具栏
选择详细配置菜单或按钮
系统设置
默认启动项目配置
启动IDEA时,默认自动打开上次开发的项目?还是自己选择? 如果去掉Reopen last project on startup前面的对勾,每次启动IDEA就会出现如下界面:
取消自动更新
1 | Settings-->Appearance & Behavior->System Settings -> Updates |
默认都打√了,建议检查IDE更新的√去掉,检查插件更新的√选上。
设置整体主题
选择主题
设置菜单和窗口字体和大小
设置IDEA背景图
选择一张合适的图片作为背景,即可。
设置编辑器主题样式
编辑器主题
字体大小
更详细的字体与颜色如下:
1 | 温馨提示:如果选择某个font字体,中文乱码,可以在fallback font(备选字体)中选择一个支持中 |
注释的字体颜色
- Block comment:修改多行注释的字体颜色
- Doc Comment –> Text:修改文档注释的字体颜色
- Line comment:修改单行注释的字体颜色
显示行号与方法分隔符
代码智能提示功能
IntelliJ IDEA 的代码提示和补充功能有一个特性: 区分大小写 。 如果想不区分大小写的话,就把这个对勾去掉。 建议去掉勾选 。
自动导包配置
- 默认需要自己手动导包,Alt+Enter快捷键
- 自动导包设置
- 动态导入明确的包:Add unambiguous imports on the fly,该设置具有全局性;
- 优化动态导入的包:Optimize imports on the fly,该设置只对当前项目有效;
设置项目文件编码(一定要改)
说明: Transparent native-to-ascii conversion主要用于转换ascii,显式原生内容。一般都要勾选。
设置控制台的字符编码
修改类头的文档注释信息
比如:
1 | /** |
常用的预设的变量,这里直接贴出官网给的:
1 | ${PACKAGE_NAME} - the name of the target package where the new class or interface will |
设置自动编译
1 | Settings-->Build,Execution,Deployment-->Compiler |
取消双击shift搜索
因为我们按shift切换中英文输入方式,经常被按到,总是弹出搜索框,太麻烦了。可以取消它。
- 方式1:适用于IDEA 2022.1.2版本
在2022.1版本中,采用如下方式消双击shift出现搜索框:搜索double即可,勾选Disable double modifier key shortcuts,禁用这个选项。
- 方式2:适用于IDEA 2022.1.2之前版本
双击shift 或 ctrl + shift + a,打开如下搜索窗口:
选择registry…,找到”ide.suppress.double.click.handler”,把复选框打上勾就可以取消双击shift出现搜索框了。
其它设置
- 是否在单行显式编辑器选项卡(建议去掉勾选)
- 设置代码样式:比如,设置import显示”*”时的个数
1 | 总结: |
后记
增进开发效率
评论
匿名评论隐私政策
✅ 你无需删除空行,直接评论以获取最佳展示效果