IntelliJ IDEA 快捷键
目录
- 参考资料
- windows 和 Linux 下快捷键
- 1. 必须记住
- 2. 常用
- 3. 调试
- 4. 查找/替换
- 5. 编辑
- 6. 重构
- 7. 导航
- 8. 编译和运行
- 9. 查找使用情况
- 10. 版本控制/本地历史
- 11. 模板
参考资料
IntelliJ IDEA 快捷键官方文档
windows 和 Linux 下快捷键
1. 必须记住
| 功能 | 快捷键 |
|---|---|
| 智能代码补全 | Ctrl?+?Shift?+?Space |
| 全部查找 | Double Shift |
| Show intention actions and quick-fixes | Alt?+?Enter |
| 生成代码 | Alt?+?Ins |
| 参数信息 | Ctrl?+?P |
| 扩大选中内容 | Ctrl?+?W |
| 缩小选中内容 | Ctrl?+?Shift?+?W |
| 打开最近编辑过的文件列表 | Ctrl?+?E |
| 重命名 | Shift?+?F6 |
2. 常用
| 功能 | 快捷键 |
|---|---|
| 打开相应的工具窗口 | Alt?+?#[0-9] |
| 保存所有 | Ctrl?+?S |
| Synchronize | Ctrl?+?Alt?+?Y |
| 切换最大化编辑器 | Ctrl?+?Shift?+?F12 |
| 检查当前文件 | Alt?+?Shift?+?I |
| 快速切换当前的工作空间(比如切换代码风格,主题,编辑器颜色等) | Ctrl?+?BackQuote |
| 打开设置对话框 | Ctrl?+?Alt?+?S |
| 打开项目结构对话框 | Ctrl?+?Alt?+?Shift?+?S |
| Find Action | Ctrl?+?Shift?+?A |
3. 调试
| 功能 | 快捷键 |
|---|---|
| 跳过当前断点?/?进入 | F8/F7 |
| 智能进入?/?退出 | Shift?+?F7/Shift?+?F8 |
| 运行到光标 | Alt?+?F9 |
| Evaluate expression | Alt?+?F8 |
| Resume program | F9 |
| 添加断点 | Ctrl?+?F8 |
| 查看所有断点 | Ctrl?+?Shift?+?F8 |
4. 查找/替换
| 功能 | 快捷键 |
|---|---|
| 在所有地方查找 | Double Shift |
| 查找 | Ctrl?+?F |
| 查找下一个?/?前一个 | F3/Shift?+?F3 |
| 替换 | Ctrl?+?R |
| 在路径下查找 | Ctrl?+?Shift?+?F |
| 在路径下替换 | Ctrl?+?Shift?+?R |
| 选择下一个发生的位置 | Alt?+?J |
| 选择所有出现的地方 | Ctrl?+?Alt?+?Shift?+?J |
| 取消选择出现的地方 | Alt?+?Shift?+?J |
5. 编辑
| 功能 | 快捷键 |
|---|---|
| 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 |
| 展开?/?折叠代码块 | Ctrl?+?NumPad+/- |
| 展开所有方法 | Ctrl?+?Shift?+?NumPad+ |
| 折叠所有方法 | Ctrl?+?Shift?+?NumPad- |
| 关闭当前页签 | Ctrl?+?F4 |
6. 重构
| 功能 | 快捷键 |
|---|---|
| 复制 | F5 |
| 移动 | F6 |
| 安全删除 | Alt?+?Delete |
| 重命名 | Shift?+?F6 |
| 重命名当前文件 | Ctrl?+?Alt?+?Shift?+?T |
| 改变方法签名 | Ctrl?+?F6 |
| 将代码排成1行 | Ctrl?+?Alt?+?N |
| 提取方法 Method | Ctrl?+?Alt?+?M |
| 提取 Variable | Ctrl?+?Alt?+?V |
| 提取 Field | Ctrl?+?Alt?+?F |
| 提取 Constant | Ctrl?+?Alt?+?C |
| 提取 Parameter | Ctrl?+?Alt?+?P |
7. 导航
| 功能 | 快捷键 |
|---|---|
| 跳转到某个 class | Ctrl?+?N |
| 跳转到某个文件 | Ctrl?+?Shift?+?N |
| Go to symbol | Ctrl?+?Alt?+?Shift?+?N |
| 切换到下一个?/?前一个 editor tab | Alt?+?Right/Left |
| 返回前一个工具窗口 | F12 |
| 从工具窗口返回到代码编辑器 | Esc |
| 隐藏当前或上一个激活的窗口 | Shift?+?Esc |
| 跳转到某一行 | Ctrl?+?G |
| 最近打开的文件清单 | 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. 编译和运行
| 功能 | 快捷键 |
|---|---|
| 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. 查找使用情况
| 功能 | 快捷键 |
|---|---|
| Find usages?/?Find usages in file | Alt?+?F7/Ctrl?+?F7 |
| Highlight usages in file | Ctrl?+?Shift?+?F7 |
| Show usages | Ctrl?+?Alt?+?F7 |
10. 版本控制/本地历史
| 功能 | 快捷键 |
|---|---|
| 项目提交到 VCS | Ctrl?+?K |
| 从 VCS 更新项目 | Ctrl?+?T |
| 推送已提交内容 | Ctrl?+?Shift?+?K |
| 快速弹出 ‘VCS’ | Alt?+?BackQuote |
11. 模板
| 功能 | 快捷键 |
|---|---|
| Surround with Live Template | Ctrl?+?Alt?+?J |
| Insert Live Template | Ctrl?+?J |