Commonly used shortcut keys
The Ctrl + Shift + A shortcut key can find all Intellij commands, and there are shortcut key information, which can be described as a great magic key, and it is also a tool for us to understand and learn shortcut keys.
Auto code shortcuts
Shortcut keys (note explanation in parentheses)
meaning
Ctrl + Alt + O
Optimize imported classes and packages
Alt + Insert
Generate code (such as get, set method, constructor, etc.)
fori / sout / psvm + Tab
Quickly generate loop/output/main function
Ctrl+Alt+T
Generate try catch
Ctrl + O (Override)
Rewrite method
Ctrl + I (Implement)
Implementation
Ctr+shift+U
Case conversion
ALT+Enter
Import package, automatic correction
ALT + /
Code hint (corresponding to Eclipse)
Ctrl + J
Automatic code
Ctrl + Shift + J
Integrate two lines into one line
Ctrl + space
Code hint
Ctrl + Shift + space
Auto-completion code
Ctrl + Alt + L
Format code
Ctrl + Alt + I
Auto indent
Ctrl + E
View recently changed code
Ctrl + Alt + space
Class name or interface name prompt
Ctrl + P
Method parameter prompt
Ctrl + Q
You can see the declaration of the current method
Shift + F6
Refactoring-renaming (packages, classes, methods, variables, comments, etc.)
Ctrl + Alt + V
Extract variables
Query shortcut keys
hot key
meaning
Ctrl + Shift + Backspace
Jump to the last edited place
Ctrl + Alt + Left/Right
Navigate the edited place back and forth
Alt + 7
The left window shows the structure of the current file
Ctrl + F12
Floating display the structure of the current file
Alt + F7
Find all references to your function/variable/class
Ctrl + Alt + F7
Find all references to your function/variable/class
Ctrl + Shift + Alt + N
Find methods or variables in the class
double Shift
Find files in all directories in the project
Ctrl + N
Lookup class
Ctrl + Shift + N
Find files
Ctrl + G
Locate line
Ctrl + F
Find text in the current window
Ctrl + Shift + F
在指定窗口查找文本
Ctrl + R
当前窗口口替换文本
Ctrl + Shift + R
在指定窗口替换文本
Alt + Shift + C
查找修改的文本
Ctrl + E
最近打开的文件
F3
向下查找关键字出现的位置
Shift + F3
向上查找关键字出现的位置
F4
查找变量来源
Ctrl + Shift + O
弹出显示查找内容
Ctrl + W
选中代码(连续按会有其他效果)
F2 / Shift + F2
高亮error/warning快速定位
Ctrl + UP/Down
光标跳转到第一行或最后一行下
Ctrl + B
快速打开光标处的类或者方法
Ctrl + Alt + B
查找所有的子类
Ctrl + Shift + B
查找变量的类
Ctrl + Alt + Left/Right
返回到上次浏览过的位置
Ctrl + Shift + Up/Down
上下移动代码
Ctrl + X
删除行
Ctrl + D
复制行
Ctrl + H
显示类结构图
Ctrl + Q
显示注释文档
Alt + F1
查找代码所在位置
Alt + 1
快速打开或隐藏工程面板
Alt + Left/Right
切换代码视图
Alt + Up/Down
在方法之间快速移动定位
Ctrl + Alt + Left/Right
前后导航编辑过的地方
Alt + 6
查找TODO
其他快捷键
快捷键
含义
Shift + Enter
另起一行
Ctrl + Shift + Z
取消之前的撤销操作
Ctrl + Alt + F12
资源管理器打开文件夹
Alt + F1
查找文件所在目录位置
Shift + Alt + Insert
竖编辑模式
Ctrl + F4
关闭当前窗口
Ctrl + Alt + V
自动导入变量定义
Ctrl + ~
快速切换方案(如界面外观、代码风格、快捷键映射等)
调试快捷键
快捷键
含义
Alt + F8
debug时选中,查看值
Alt + F9
运行至光标处
F9
恢复程序
Alt+F10
定位到断点
重构快捷键
快捷键
含义
Ctrl + Alt + Shift + T
弹出重构菜单
Shift+F6
重命名
Alt + Delete
安全删除
Ctrl + Alt + N
内联