跳至主要內容

IDEA快捷键(windows)

晨光-向大约 6 分钟开发工具IDE开发工具

IDEA快捷键(windows)

1. 官方文档

IntelliJIDEA_ReferenceCard.pdf (jetbrains.com)open in new window

image-20230227201704655
image-20230227201704655
image-20230227201728450
image-20230227201728450

其他参考:
IntelliJ IDEA快捷键大全 + 动图演示!open in new window

2. 文档翻译

1. 记住这些快捷键

REMEMBER THESE SHORTCUTS记住这些快捷键
Smart code completion智能代码完成Ctrl + Shift + Space
Search everywhere全局搜索Double Shift
Show intention actions and quick-fixes显示提示和快速修复Alt + Enter
Generate code生成代码Alt + Ins
Parameter info参数信息Ctrl + P
Extend selection扩展选择Ctrl + W
Shrink selection收缩选择Ctrl + Shift + W
Recent files popup最近的文件弹出窗口Ctrl + E
Rename重命名Shift + F6

2. 综合的

GENERAL综合的
Open corresponding tool window打开相应的工具窗口Alt + #[0-9]
Save all保存所有Ctrl + S
Synchronize同步Ctrl + Alt + Y
Toggle maximizing editor切换最大化编辑器Ctrl + Shift + F12
Inspect current file with current profile使用当前配置文件检查当前文件Alt + Shift + I
Quick switch current scheme快速切换当前主题Ctrl + BackQuote (`)
Open Settings dialog打开"设置"对话框Ctrl + Alt + S
Open Project Structure dialog打开"项目结构"对话框Ctrl + Alt + Shift + S
Find Action寻找操作Ctrl + Shift + A

3. 调试

DEBUGGING调试
Step over / into跳过/跳入F8/F7
Smart step into / Step out快速跳入/跳出Shift + F7/Shift + F8
Run to cursor运行到光标Alt + F9
Evaluate expression计算表达式Alt + F8
Resume program恢复程序F9
Toggle breakpoint切换断点Ctrl + F8
View breakpoints查看断点Ctrl + Shift + F8

4. 搜索/替换

SEARCH / REPLACE搜索/替换
Search everywhere全局搜索Double Shift
Find搜索Ctrl + F
Find next / previous搜索下一个/上一个F3/Shift + F3
Replace替换Ctrl + R
Find in path在路径中搜索Ctrl + Shift + F
Replace in path在路径中替换Ctrl + Shift + R
Select next occurrence选择下一个引用Alt + J
Select all occurrences选择所有引用Ctrl + Alt + Shift + J
Unselect occurrence取消选择事件Alt + Shift + J

5. 编辑

EDITING编辑
Basic code completion基本代码完成Ctrl + Space
Smart code completion智能代码完成Ctrl + Shift + Space
Complete statement完整声明Ctrl + Shift + Enter
Parameter info参数信息Ctrl + P
Quick documentation lookup快速文档查找Ctrl + Q
External Doc外部文档Shift + F1
Brief Info简要信息Ctrl + mouse
Show descriptions of error at caret显示插入符号处的错误说明Ctrl + F1
Generate code…生成代码…Alt + Insert
Override methods重写方法Ctrl + O
Implement methods实现方法Ctrl + I
Surround with…环绕Ctrl + Alt + T
Comment / uncomment with line comment注释/取消行注释Ctrl + /
Comment / uncomment with block comment注释/取消块注释Ctrl + Shift + /
Extend selection扩展选择Ctrl + W
Shrink selection收缩选择Ctrl + Shift + W
Context info上下文信息Alt + Q
Show intention actions and quick-fixes显示提示和快速修复Alt + Enter
Reformat code格式化代码Ctrl + Alt + L
Optimize imports优化进口Ctrl + Alt + O
Auto-indent line(s)自动缩进行Ctrl + Alt + I
Indent / unindent selected lines缩进/取消缩进选中行Tab/Shift + Tab
Cut current line to clipboard将当前行剪切到剪贴板Ctrl + X, Shift + Delete
Copy current line to clipboard将当前行复制到剪贴板Ctrl + C , Ctrl + Insert
Paste from clipboard从剪贴板粘贴Ctrl + V, Shift + Insert
Paste from recent buffers…从最近的缓冲区粘贴Ctrl + Shift + V
Duplicate current line复制当前行Ctrl + D
Delete line at caret删除当前行Ctrl + Y
Smart line join智能线路连接Ctrl + Shift + J
Smart line split插入行Ctrl + Enter
Start new line换行Shift + Enter
Toggle case for word at caret or selected block切换大小写Ctrl + Shift + U
Select till code block end / start选中至代码块结束/开始Ctrl + Shift + ]/[
Delete to word end删除到字结尾Ctrl + Delete
Delete to word start删除到字开始Ctrl + Backspace
Expand / collapse code block展开/折叠代码块Ctrl + NumPad+/-
Expand al展开所有Ctrl + Shift + NumPad+
Collapse all折叠所有Ctrl + Shift + NumPad-
Close active editor tab关闭活动编辑器选项卡Ctrl + F4

6. 重构

REFACTORING重构
Copy复制F5
Move移动F6
Safe Delete安全删除Alt + Delete
Rename重命名Shift + F6
Refactor this重构Ctrl + Alt + Shift + T
Change Signature更改签名Ctrl + F6
Inline内联Ctrl + Alt + N
Extract Method提取方法Ctrl + Alt + M
Extract Variable提取变量Ctrl + Alt + V
Extract Field提取字段Ctrl + Alt + F
Extract Constant提取常数Ctrl + Alt + C
Extract Parameter提取参数Ctrl + Alt + P

7. 导航

NAVIGATION导航
Go to class搜索类Ctrl + N
Go to file搜索文件Ctrl + Shift + N
Go to symbol搜索符号Ctrl + Alt + Shift + N
Go to next / previous editor tab跳转到下一个/上一个编辑器选项卡Alt + Right/Left
Go back to previous tool window返回到上一个工具窗口F12
Go to editor (from tool window)跳转到编辑器(从工具窗口)Esc
Hide active or last active window隐藏活动窗口或上次活动窗口Shift + Esc
Go to line跳转到指定行Ctrl + G
Recent files popup最近的文件弹出窗口Ctrl + E
Recent locations popup最近位置弹出窗口Ctrl + Shift + E
Navigate back / forward向后/向前导航Ctrl + Alt + Left/Right
Navigate to last edit location导航到最后一个编辑位置Ctrl + Shift + Backspace
Select current file or symbol in any view在任何视图中选择当前文件或符号Alt + F1
Go to declaration跳转到声明Ctrl + B, Ctrl + Click
Go to implementation(s)跳转到实现类Ctrl + Alt + B
Open quick definition lookup打开快速定义查找Ctrl + Shift + I
Go to type declaration跳转到类型声明Ctrl + Shift + B
Go to super-method / super-class跳转到超级方法/超级类Ctrl + U
Go to previous / next method跳转到上一个/下一个方法Alt + Up/Down
Move to code block end / start移动到代码块结束/开始Ctrl + ]/[
File structure popup文件结构弹出窗口Ctrl + F12
Type hierarchy类型层次结构Ctrl + H
Method hierarchy方法层次Ctrl + Shift + H
Call hierarchy调用层次结构Ctrl + Alt + H
Next / Previous highlighted error下一个/上一个突出的错误F2/Shift + F2
Edit source / View source编辑源/查看源F4/Ctrl + Enter
Show navigation bar显示导航栏Alt + Home
Toggle bookmark切换书签F11
Toggle bookmark with mnemonic使用助记符切换书签Ctrl + F11
Go to numbered bookmark跳转到编号书签Ctrl + #[0-9]
Show bookmarks显示书签Shift + F11

8. 编译和运行

COMPILE AND RUN编译和运行
Build project编译项目Ctrl + F9
Compile selected file, package or module编译选定的文件、包或模块Ctrl + Shift + F9
Select configuration and run / debug选择配置并运行/调试Alt + Shift + F10/F9
Run / Debug运行/调试Shift + F10/F9
Run context configuration from editor从编辑器运行上下文配置Ctrl + Shift + F10
Run anything运行所有Double Ctrl

9. 使用搜索

USAGE SEARCH使用搜索
Find usages / Find usages in file查找用法/在文件中查找用法Alt + F7/Ctrl + F7
Highlight usages in file突显文件中的用法Ctrl + Shift + F7
Show usages显示用法Ctrl + Alt + F7

10. 版本控制/本地历史

VCS / LOCAL HISTORY版本控制/本地历史
Commit project to VCS提交项目到"VCS"Ctrl + K
Update project from VCS从"VCS"更新项目Ctrl + T
Push commits推送提交Ctrl + Shift + K
‘VCS’ quick popupVCS快速弹出Alt + BackQuote (`)
LIVE TEMPLATES动态模板
Surround with Live Template用动态模板环绕Ctrl + Alt + J
Insert Live Template插入动态模板Ctrl + J

3. 自定义快捷键

添加快捷键 Alt+E

4. 扩展

IDEA删除当前一行 快捷键open in new window