文章目录
- 一、性能优化
- 二、优化设置
- 1. IntelliJ IDEA包层级结构显示(让空文件夹不要默认在同一行)
- 2. IntelliJ IDEA设置自动导入包
- 3. 显示方法分隔符
- 4. 忽略大小写提示
- 5. 主题设置
- 6. 设置字体
- 7. 设置字符编码
- 8. 打开IDEA不自动启动项目
- 9. idea 版本控制默认文件修改了,所属目录的颜色跟着变化
- 10. idea 修改git不同状态文件的颜色
- 11. idea 直接修改maven配置文件
- 12. idea 設置折叠展开所有方法和单个方法
- 13. 设置多行tab
- 14. IDEA全局设置
- 15. IDEA 编译错误编辑时总是跳转到第一个错误或者开启自动编译切换窗口后总是跳转窗口的解决方案
- 16. 实时显示IDEA内存情况
- 17. idea 2024.2切换到旧版的UI
- 18. 设置鼠标滚轮修改字体大小
- 19. 设置超过指定 import 个数,改为*
- 20. idea使用/***/单行注释格式化后会显示多行,如何能保持单行显示
- 三、常用快捷键
- 四、插件
一、性能优化
1. JVM启动参数
(1)可根据电脑内存大小各自调节,找到IDEA安装目录的bin目录,找到idea.exe.vmoptions、idea64.exe.vmoptions编辑这两文件,相关配置及说明如下图标红字处,其他默认即可。
(2)通过菜单来进行设置JVM启动参数,IDEA会优先使用这个菜单下的配置文件设置参数和(1)相同,设置方法如下图:Help =>Edit Custom VM Options
2. 清空缓存并重建索引
将编译的进程与maven的堆设置大一些
二、优化设置
1. IntelliJ IDEA包层级结构显示(让空文件夹不要默认在同一行)
例如:excel和template在一行
取消勾选Compact Middle Packages(紧凑中间包)
2. IntelliJ IDEA设置自动导入包
File | Settings | Editor | General | Auto Import
3. 显示方法分隔符
File | Settings | Editor | General | Appearance
4. 忽略大小写提示
File | Settings | Editor | General | Code Completion
5. 主题设置
File | Settings | Appearance & Behavior | Appearance
推荐几个个主题网站
主题网站1:http://color-themes.com/?view=index
主题网站2:http://www.riaway.com/
主题网站3:http://www.eclipsecolorthemes.org/
6. 设置字体
File | Settings | Editor | Font
7. 设置字符编码
File | Settings | Editor | File Encodings
8. 打开IDEA不自动启动项目
File | Settings | Appearance & Behavior | System Settings
9. idea 版本控制默认文件修改了,所属目录的颜色跟着变化
旧版本 File | Settings | Version Control 勾选 “show directories with changed descendants”
2024版本 File | Settings | Version Control | Confirmation
10. idea 修改git不同状态文件的颜色
File | Settings | Version Control | File Status Colors
11. idea 直接修改maven配置文件
pom.xml右键 => maven => Open’setting.xml’
12. idea 設置折叠展开所有方法和单个方法
File --> settings --> keymap --> 搜索fol ctrl+shift+/(小键盘) ctrl+shift+*(小键盘) 单个方法ctrl + +(小键盘) ctrl + -(小键盘)
13. 设置多行tab
File | Settings | Editor | General | Editor Tabs
14. IDEA全局设置
老版的IDEA更改默认配置是在File | Other Settings | Default Settings
2021版本的放在了New Projects Setup | Settings for New Projects
15. IDEA 编译错误编辑时总是跳转到第一个错误或者开启自动编译切换窗口后总是跳转窗口的解决方案
如果总是跳转到错误处,取消勾选编译设置中的 Automatically show first error in editor:
如果是开启了自动编译,切换窗口后编译错误又总是跳回 IDEA,可以把编译后的操作由 Build 换成 Build, no error check:
16. 实时显示IDEA内存情况
随机在一个项目中,双击Shift弹出窗口,该配置是全局配置,输入memory,开启
17. idea 2024.2切换到旧版的UI
File | Settings | Appearance & Behavior | New UI
18. 设置鼠标滚轮修改字体大小
File | Settings | Editor | General
19. 设置超过指定 import 个数,改为*
File | Settings | Editor | Code Style | Java
20. idea使用/***/单行注释格式化后会显示多行,如何能保持单行显示
File | Settings | Editor | Code Style | Java
三、常用快捷键
1. 快速匹配方法的大括号位置
ctrl+[ ctrl+] 可以快速跳转到方法大括号的起止位置
2. 查看方法在哪里被调用
ctrl+alt+h 可以清楚看到方法在哪些地方被调用;
3. 代码结尾补全
例如一行代码补全分号,或者是if(xxx) 补全大括号,按ctrl+shift+enter 无需切换鼠标光标,大幅度提升了编码效率
四、插件
1. Rainbow Brackets
颜色自定义
File | Settings | Editor | Color Scheme | Rainbow Brackets
高亮{}里的内容
Ctrl + 鼠标右键,Esc取消高亮
虚化{}外的代码
Atl + 鼠标右键,Esc取消虚化