【Tips】You can use the shortcut key Ctrl + F to search for a word, or a part of a word. "Find" the word (matching words will be marked with color) [For example, EG] We want to find the completion word, press Ctrl + F After the shortcut key. You can just enter he to find the corresponding word containing the beginning of comp, and directly select the countryside to jump to the corresponding position
一、基础相关 Base base
二、编辑相关 Edit edit
三、查找相关 Find find
四、导航相关 Navigate navigate
五、编码相关 Code code
六、完成相关 Completion completion
七、折叠相关 Folding folding
八、格式相关 Format format
九、移动相关 Move move
十、重构相关 Refactor refactor
Chapter 2: Top 10 Shortcuts (Topic Content)
1. Basic related Base base
Numbering
hot key
illustrate
01
Ctrl+]
For example, a code block enclosed by {}, use this shortcut key to quickly jump to the end of the code block
02
Ctrl+[
Same as above, quickly jump to the beginning of the code block
03
Ctrl+Shift+Enter
Fill the input if, for, function, etc. with {} or ; to make the code statement complete
04
Shift+Enter
Start a new line below the current line
05
Ctrl+Alt+Enter
Insert a new line above the current line
06
Ctrl+Delete
Delete all characters from the cursor to the end of the word
07
Ctrl+BackSpace
Delete all characters from the cursor to the beginning of the word
08
Ctrl+Left Arrow
move cursor to previous word
09
Ctrl+Right Arrow
move cursor to next word
10
Ctrl+Up Arrow
scroll up one line
11
Ctrl+Down Arrow
scroll down one line
12
Ctrl+W
select whole word
13
Ctrl+Shift+U
switch case
2. Edit related Edit edit
Numbering
hot key
illustrate
01
Ctrl+Z
revoke
02
Ctrl+Shift+Z
redo
03
Ctrl+X
cut
04
Ctrl+C
copy
05
Ctrl+V
paste
06
Ctrl+Shift+J
Merge selected lines into one line
3. Find related Find find
Numbering
hot key
illustrate
01
Ctrl+F
Find in current file
02
Ctrl+R
replace string
03
Ctrl+Shift+F
Find string in global file
04
Ctrl+Shift+R
replace string in global
05
Alt + F7
Find the use of the current variable and display it in a list
06
Ctrl+Alt+F7
Find the use of the current variable and display the dialog directly
07
Ctrl+F7
Find usage of symbols in files
08
Ctrl+Shift+F7
Highlight the use of variables in the file
4. Navigate related Navigate navigate
Numbering
hot key
illustrate
01
Ctrl+N
Find class files
02
Ctrl+Shift+N
find files
03
Ctrl+G
Navigate to a line in the file
04
Alt+Left Arrow
Return to the last cursor position
05
Alt+Right Arrow
Return to the previous cursor position
06
Ctrl+Shift+Backspace
Return to last edit position
07
Ctrl+Shift+Backslash
Return to the last edit position
08
Ctrl+B
Navigate to the location where the variable is defined
09
Ctrl+Alt+B
Navigate to the concrete implementation of the selected class or method
10
Ctrl+Shift+B
Navigate directly to the type definition of the variable under the cursor
11
Ctrl+U
Directly locate the method definition of the current method override or implements
12
Ctrl+F12
Display the file structure of the current file
13
Ctrl+Alt+F12
Display the path of the current file, and can easily open the relevant parent path
14
Ctrl+H
Displays the inheritance hierarchy of the current class
15
Ctrl+Shift+H
Displays the inheritance hierarchy of the current method
16
Ctrl+Alt+H
Displays the call hierarchy of the current method
17
F2
Navigate to the next error
18
Shift+F2
Navigate to the previous error
19
Ctrl+Alt+Up Arrow
Find where the previous variable co-occurs
20
Ctrl+Alt+Down Arrow
Find where the next variable co-occurs
5. Coding related Code code
Numbering
hot key
illustrate
01
Ctrl+O
Overriding base class methods
02
Ctrl+I
Implement a method in a base class or interface
03
Alt + Insert
Generate constructors, getter/setter methods, toString methods, etc.
04
Ctrl+Alt+T
Wrap the selected code with if, while, try/catch, etc.
05
Ctrl+Shift+Delete
Remove related packaging code
6. Completion completion
Numbering
hot key
illustrate
01
Alt+/
automatic completion
02
Alt + Enter
auto prompt complete
Seven, folding related Folding folding
Numbering
hot key
illustrate
01
Ctrl+=
expand code
02
Ctrl±
shrink code
03
Ctrl+Alt+=
Recursively expand code
04
Ctrl+Alt±
recursive contraction code
05
Ctrl+Shift+=
expand all code
06
Ctrl+Shift±
Shrink all code
Eight, format related Format format
Numbering
hot key
illustrate
01
Ctrl+J
Insert Live Template
02
Ctrl+Alt+J
使用Live Template包装
03
Ctrl+/
使用//进行注释
04
Ctrl+Shift+/
使用/**/进行注释
05
Ctrl+Alt+L
格式化代码
06
Ctrl+Alt+I
自动缩进行
07
Ctrl+Alt+O
Ctrl+Alt+O
九、移动相关 Move move
编号
快捷键
说明
01
Ctrl+Shift+向下箭头
将光标所在的代码块向下整体移动
02
Ctrl+Shift+向上箭头
将光标所在的代码块向上移动
03
Ctrl+Alt+Shift+向左箭头
将元素向左移动
04
Ctrl+Alt+Shift+向右箭头
将元素向右移动
05
Alt+Shift+向下箭头
将行向下移动
06
Alt+Shift+向上箭头
将行向上移动
十、重构相关 Refactor refactor
编号
快捷键
说明
01
Shift+F6
重命名
02
Ctrl+F6
更改函数签名
03
Ctrl+Shift+F6
更改类型
Ctrl
快捷键
介绍
Ctrl + F
在当前文件进行文本查找 (必备)
Ctrl + R
在当前文件进行文本替换 (必备)
Ctrl + Z
撤销 (必备)
Ctrl + Y
删除光标所在行 或 删除选中的行 (必备)
Ctrl + X
剪切光标所在行 或 剪切选择内容
Ctrl + C
复制光标所在行 或 复制选择内容
Ctrl + D
复制光标所在行 或 复制选择内容,并把复制内容插入光标位置下面 (必备)
Ctrl + W
递进式选择代码块。可选中光标所在的单词或段落,连续按会在原有选中的基础上再扩展选中范围 (必备)
Ctrl + E
显示最近打开的文件记录列表
Ctrl + N
根据输入的 类名 查找类文件
Ctrl + G
在当前文件跳转到指定行处
Ctrl + J
插入自定义动态代码模板
Ctrl + P
方法参数提示显示
Ctrl + Q
光标所在的变量 / 类名 / 方法名等上面(也可以在提示补充的时候按),显示文档内容
Ctrl + U
前往当前光标所在的方法的父类的方法 / 接口定义
Ctrl + B
进入光标所在的方法/变量的接口或是定义出,等效于 Ctrl + 左键单击
Ctrl + K
版本控制提交项目,需要此项目有加入到版本控制才可用
Ctrl + T
版本控制更新项目,需要此项目有加入到版本控制才可用
Ctrl + H
显示当前类的层次结构
Ctrl + O
选择可重写的方法
Ctrl + I
选择可继承的方法
Ctrl + +
展开代码
Ctrl + -
折叠代码
Ctrl + /
注释光标所在行代码,会根据当前不同文件类型使用不同的注释符号 (必备)
Ctrl + [
移动光标到当前所在代码的花括号开始位置
Ctrl + ]
移动光标到当前所在代码的花括号结束位置
Ctrl + F1
在光标所在的错误代码出显示错误信息
Ctrl + F3
调转到所选中的词的下一个引用位置
Ctrl + F4
关闭当前编辑文件
Ctrl + F8
在 Debug 模式下,设置光标当前行为断点,如果当前已经是断点则去掉断点
Ctrl + F9
执行 Make Project 操作
Ctrl + F11
选中文件 / 文件夹,使用助记符设定 / 取消书签
Ctrl + F12
弹出当前文件结构层,可以在弹出的层上直接输入,进行筛选
Ctrl + Tab
编辑窗口切换,如果在切换的过程又加按上delete,则是关闭对应选中的窗口
Ctrl + Enter
智能分隔行
Ctrl + End
跳到文件尾
Ctrl + Home
跳到文件头
Ctrl + Space
基础代码补全,默认在 Windows 系统上被输入法占用,需要进行修改,建议修改为 Ctrl + 逗号(必备)
Ctrl + Delete
删除光标后面的单词或是中文句
Ctrl + BackSpace
删除光标前面的单词或是中文句
Ctrl + 1,2,3…9
定位到对应数值的书签位置
Ctrl + 左键单击
在打开的文件标题上,弹出该文件路径
Ctrl + 光标定位
按 Ctrl 不要松开,会显示光标所在的类信息摘要
Ctrl + 左方向键
光标跳转到当前单词 / 中文句的左侧开头位置
Ctrl + 右方向键
光标跳转到当前单词 / 中文句的右侧开头位置
Ctrl + 前方向键
等效于鼠标滚轮向前效果
Ctrl + 后方向键
等效于鼠标滚轮向后效果
Alt
快捷键
介绍
Alt + `
显示版本控制常用操作菜单弹出层
Alt + Q
弹出一个提示,显示当前类的声明 / 上下文信息
Alt + F1
显示当前文件选择目标弹出层,弹出层中有很多目标可以进行选择
Alt + F2
对于前面页面,显示各类浏览器打开目标选择弹出层
Alt + F3
选中文本,逐个往下查找相同文本,并高亮显示
Alt + F7
查找光标所在的方法 / 变量 / 类被调用的地方
Alt + F8
在 Debug 的状态下,选中对象,弹出可输入计算表达式调试框,查看该输入内容的调试结果
Alt + Home
定位 / 显示到当前文件的 Navigation Bar
Alt + Enter
IntelliJ IDEA 根据光标所在问题,提供快速修复选择,光标放在的位置不同提示的结果也不同 (必备)