IDEA快捷操作

一.Essensial

基本的

1.Context actions

Alt+Enter:显示上下文菜单
Ctrl+Space:激活建议菜单
Ctrl+Shift+Enter:完成补全

2.Search for actions

Ctrl+Shift+A:搜索action
Ctrl+N:搜索类
Ctrl+Shift+N:搜索文件
Ctrl+Alt+Shift+N:搜索变量或方法

二.Editor basics

1.Expand and shrink code selection

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

2.Comment lines and blocks of code

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

3.Duplicate and delete lines

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

4.Move code fragments

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

5.Collapse

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

6.Surround and unwrap

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

7.Multiple selection

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

三.Code Completion

1.Type-matching completion

Ctrl+Shift+space:智能提示

2.Postfix completion

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

3.Statement completion

Ctrl+Shift+Enter:语句补全

4.Completion with tab

tab:覆盖
Enter:插入

四.Refactoring

重构

1.Rename

Shift+F6:重命名

2.Extract variable

Ctrl+Alt+V:抽取变量

3.Extract method

Ctrl+Alt+M:抽取方法

4.Refactoring menu

Ctrl+Alt+Shift+T:重构菜单

五.Code assistance

1.Parameter info

Ctrl+P:参数信息

2.Quick popups

Ctrl+Q:快速文档
Ctrl+Shift+I:符号定义(方法、类等的定义)

3.Code format

Ctrl+Alt+L:代码格式化

六.Navigation

1.Search everywhere

Shift(2):随处搜索

2.Find and replace in files

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

3.File structure

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

4.Declare and usages

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

5.Recent files and locations

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

posted @ 2023-11-26 16:53  框框A  阅读(32)  评论(0编辑  收藏  举报