当前的IntelliJ IDEA 的版本是2021.2.2
(下载IntelliJ IDEA)
ps:不同版本一些图标和设置位置可能会存在差异,但应该大部分都差不多。
搜索操作
原文 | 解释 | 快捷键 |
---|
Find… | 当前页搜索 | Ctrl+F |
Find in Path… | 指定路径搜索 | Ctrl+Shift+F |
Search Everything | 全局搜索 | 全局搜索 Shift+Shift |
Search Class | 类全局搜索 | Ctrl+N |
Search File | 文件全局搜索 | Ctrl+Shift+N |
Replace a string in active editor with another string | 搜索并替换 | Ctrl + R |
层级关系查看
原文 | 解释 | 快捷键 |
---|
Type Hierarchy | 类的层级关系 | Ctrl + H |
Method Hierarchy | 方法的层级关系 | Ctrl + Shift + H |
Call Hierarchy | 调用的层级关系 | Ctrl + Alt + H |
Show UML Diagram | UML图展示 、UML浮窗展示 | Ctrl + Alt + Shift + U 、Ctrl + Alt + U |
光标选择
原文 | 解释 | 快捷键 |
---|
Select Line at Caret | 选择光标所在行的开始和结尾 | Shift+Home 、Shift + End |
Move Caret to Line End | 移动光标到行的末尾 | End |
Move Caret to Line Start | 移动光标到行的开始 | Home |
Move Caret to Text Start | 光标移动到文档开头 | Ctrl + Home |
Move Caret to Text End | 光标移动到文档结尾 | Ctrl+ End |
Move Caret to Text Start with Selection | 选择并移动光标到文档开头 | Ctrl + Shift + Home |
Move Caret to Text End with Selection | 选择并移动光标到文档结尾 | Ctrl + Shift + End |
Extend Selection | 扩大选择范围,整个单词或者完整的代码块 | Ctrl + W |
Left with Selection | 单个字符向左选择 | Shift+向左箭头 |
Right with Selection | 单个字符向右选择 | Shift+向右箭头 |
Move Caret to Previous Word with Selection | 根据完整单词光标向左移动并选择 | Ctrl+Shift+向左箭头 |
Move Caret to Nex Word with Selection | 根据完整单词光标向右移动并选择 | Ctrl+Shift+向右箭头 |
Select ALL | 选择全部文档 | Ctrl+A |
Select All Occurrences | 选中与光标选中相同的所有字母 | Ctrl + Alt + Shift + J |
代码定位
原文 | 解释 | 快捷键 |
---|
Find Usages | 搜索光标所在的类和方法在哪被使用 | Alt+F7 |
Go to Declaration or Usages | 进入到类、接口、变量的声明和引用 | Ctrl+B、Ctrl + 鼠标左键 |
Implementation | 查看该接口实现类或实现方法 | Ctrl+Alt+B、Ctrl+Alt+鼠标左键 |
Next Highlighted Error | 快速定位到下一个错误行 | F2 |
Previous Highlighted Error | 快速定位到上一个错误行 | Shift + F2 |
Go to Line:Column | 快速定位到指定的第几行 | Ctrl + G |
代码操作
原文 | 解释 | 快捷键 |
---|
Extract Method… | 提取方法(选择的代码抽取成方法) | Ctrl + Alt + M |
Surround With… | 围绕处理(选择的代码被if while等包裹) | Ctrl + Alt + T |
Delete Line | 删除行 | Ctrl+Y |
Duplicate Line or Selection | 重复行(复制行) | Ctrl+D |
Join Lines | 折叠行 | Ctrl+Shift+j |
Start New Line | 开始新的一行(默认当前行下一行) | Shift + Enter |
Start New Line Before Current | 开始新的一行(当前行之前) | Ctrl + Alt + Enter |
Move Line Down | 向下移动行 | Alt+Shift+向下箭头 |
Move Line Up | 向上移动行 | Alt+Shift+向上箭头 |
Surround selection on typing quote or brace | 选择代码片段,添加双引号(需要去Settings->Editor->General->Smart Keys中设置勾选) | Shift + " |
Reformat Code | 代码格式化 | Ctrl+Alt+L |
Override base class methods in the current class | 重写方法 | Ctrl + O |
Generate | 生成geet/seet/构造器/toString等方法 | Alt+insert |
Unindent Line or Selection | 取消首行缩进 | Shift+Tab |
Edit | 编辑提示,根据代码问题提示解决方案 | Alt + Enter |
Quick Documentation | 查阅方法文档说明 | Ctrl + Q |
Rename the selected symbol and correct all references | 重命名并更正所有引用 | Shift + F6 |
Optimize Imports | 删除未使用的import包 | Ctrl+Alt+O |
Render All Doc Comments | 渲染所有文档注释 | 自定义 |
Cyclic Expand Word | 补齐词汇 | Alt + / |
Back | 后退上一步操作 | Ctrl + Alt + 左箭头 |
Forward | 前进下一步操作 | Ctrl + Alt + 右箭头 |
Git操作
原文 | 解释 | 快捷键 |
---|
Commit | 提交 | Ctrl+K |
Push | 推送 | Ctrl+Shift+K |
Pull | 拉取 | Ctrl+T |
Annotate | 提交作者 | 自定义 |
git branches | 当前项目git 分支 | Ctrl+Shift+` |
VCS Operations Popup | git所有操作弹窗 | Alt+` |
编辑器操作
原文 | 解释 | 快捷键 |
---|
Close | 关闭当前窗口 | Ctrl + F4 |
Quick Switch | 快速切换(主题、快捷键等)开关 | Ctrl+` |
Switch | 所有窗口选择开关 | Ctrl+tab |
Project Structure | 项目结构 | Ctrl + Alt + Shift + S |
Setting | 设置 | Ctrl + Alt + S |
Show Decompiled Class | 显示反编译类(class字节码) | Ctrl + Shift + Alt + Q |
Paste from history | 历史粘贴板 | Ctrl+Shift+V |
Paste without formatting | 粘贴没有格式 | Ctrl+Shift+Alt+V |
Copy path | 复制当前文件的绝对路径(盘符开始) | Ctrl+Shift+C |
Copy Reference | 复制当前文件的相对路径(包名开始) | Ctrl+Shift+Alt+C |
Quickly navigate to action by name | 通过名(包括keymap名)快速查询需要执行的操作 | Ctrl + Shift + A |