IDEA快捷操作

发布时间 2023-11-26 16:55:19作者: 框框A

查阅

Ctrl+P:参数信息(Parameter info)
Ctrl+Q:快速文档(Quick popups)
Ctrl+Shift+I:符号定义(方法、类等的定义)

Find and replace

Ctrl+F:当前文件查找
Ctrl+Shift+F:多文件查找
Ctrl+R:当前文件替换
Ctrl+Shift+R:多文件替换
F3:下一个
Shift+F3:上一个

File structure

Ctrl+F12:弹出窗口
Alt+7:工具窗口

Declare and usages

Ctr+B:跳到方法的定义处
跳过后再按Ctrl+B会显示它所有使用的地方

Context actions

Alt+Enter:显示上下文菜单

打开最近的文件

Ctrl+E
Ctrl+Shift+E:查看最近打开文件的代码

Search everywhere:

Shift(2):随处搜索

Expand and shrink code selection

Ctrl+W:增加选择
Ctrl+Shift+W:减少选择

Type-matching completion

Ctrl+Shift+space:智能提示

Postfix completion

.:后缀补全
如: .var .if .for

Statement completion

Ctrl+Shift+Enter:语句补全

Completion with tab

tab:覆盖
Enter:插入

Rename

Shift+F6:重命名

Extract variable

Ctrl+Alt+V:抽取变量

Extract method

Ctrl+Alt+M:抽取方法

Refactoring menu

Ctrl+Alt+Shift+T:反射菜单

Comment lines and blocks of code

Ctrl+/:行注释/取消
Ctrl+Shift+/:块注释/取消

Code format

Ctrl+Alt+L:代码格式化

Duplicate and delete lines

Ctrl+D:复制行
Ctrl+Y:删除行

Move code fragments

Alt+Shift+Up/Down:移动行
Ctrl+Shift+Up/Down:移动方法(光标位于方法的头部)

Collapse

Ctrl+(-/+):折叠/展开当前代码块
Ctrl+Shift+(-/+):折叠/展开所有代码块

Surround and unwrap

Ctrl+Alt+T:加包围(如:try/catch)
Ctrl+Shift+Delete:去包围

Multiple selection

Alt+J:选择当前光标所在的标识符,继续按选择相同的标识符,而且出现多光标。
Alt+Shift+J:减少最近的一次选择
Ctrl+Alt+Shift+J:选择所有的标识符