快捷键 | 快捷键符号 | 英文名称 | 功能说明 |
---|---|---|---|
Control + Space |
⌃Space | Basic code completion | 基本的代码补全(补全任何类、方法、变量),代码智能提示,因为和切换输入法快捷键冲突,所以基本改成Alt+/ |
Shift + Command + Enter |
⌘⇧↩ | Complete statement | 自动结束代码,行末自动添加分号 |
Command + P |
⌘P | Parameter info (within method call arguments) | 显示方法的参数信息 |
Control + J /F1 /Control+click |
⌃J / F1/ ⌃+click | Quick documentation lookup | 显示当前位置的变量、方法的 Documentation 内容, 快速查看文档 |
Shift + F1 |
⇧F1 | External Doc | 查看外部文档(在某些代码上会触发打开浏览器显示相关文档) |
Command + 鼠标放在代码上 |
⌘ + mouse | Brief Info | 显示代码简要信息 |
Command + F1 |
⌘F1 | Error Description | 在错误或警告处显示具体描述信息 |
Command + N, Control + Enter |
⌘N, ⌃↩, ⌃N | Generate code… | 生成代码(getter、setter、构造函数、hashCode/equals,toString) |
Control + O |
⌃O | Override methods | 覆盖方法(重写父类方法) |
Control + I |
⌃I | Implement methods | 实现方法(实现接口中的方法) |
Option + Command + T |
⌥⌘T | Surround with… | 包围代码(使用if…else, try…catch, for, synchronized等包围选中的代码) |
Option + 方向键上 |
⌥↑ | Extend selection | 连续选中代码块 |
Option + 方向键下 |
⌥↓ | Shrink selection | 减少当前选中的代码块 |
Control + Shift + Q |
⌃⇧Q | Context info | 显示上下文信息 |
Command + Option + L |
⌘⌥L | Reformat code | 格式化代码 |
Control + Option + O |
⌃⌥O | Optimize imports | 优化import |
Control + Option + I |
⌃⌥I | Auto-indent line(s) | 自动缩进线 |
Tab / Shift + Tab |
⇥ / ⇧⇥ | Indent/unindent selected lines | 缩进代码 / 反缩进代码 |
Command + X |
⌘X | Cut current line to clipboard | 剪切当前行或选定的块到剪贴板 |
Command + C |
⌘C | Copy current line to clipboard | 复制当前行或选定的块到剪贴板 |
Command + V |
⌘V | Paste from clipboard | 从剪贴板粘贴 |
Command + Shift + V |
⌘⇧V | Paste from recent buffers… | 从最近的缓冲区粘贴 |
Command+D |
⌘D | Duplicate current line | 复制光标所在行的内容,插入光标所在行下面 |
Command + Delete |
⌘⌫ | Delete line at caret | 删除当前行或选定的块的行 |
Control + Shift + J |
⌃⇧J | Smart line join | 智能的将代码拼接成一行 |
Command + Enter |
⌘↩ | Smart line split | 智能行拆分 |
Option + Enter |
⌥↩ | Show intention actions and quick-fixes | 显示意向动作/快速修复代码 |
Shift + Enter |
⇧↩ | 光标所在行下方插入空白行 | |
Option + Command + Enter |
⌥⌘↩ | 光标所在行上方插入空白行 | |
Command + Shift + U |
⌘⇧U | Toggle case for word at caret or selected block | 大小写切换 |
Shift+Command+] |
⇧⌘] | select next tab | 选择下个tab |
Shift+Command+[ |
⇧⌘[ | select previous tab | 选择上一个tab |
Command + Shift + ] / Command + Shift + [ |
⌘⇧] / ⌘⇧[ | Select till code block end/start,select next tab/previous tab | 选择直到代码块结束/开始 |
Option + Fn + Delete |
(⌦键为Fn+Delete) ⌥⌦ | Delete to word end | 删除到单词的末尾 |
Option + Delete |
⌥⌫ | Delete to word start | 删除到单词的开头 |
Command + 加号 / Command + 减号 |
⌘+ / ⌘- | Expand/collapse code block | 展开 / 折叠代码块 |
Command + Shift + 加号 |
⌘⇧+ | Expand all | 展开所有代码块 |
Command + Shift + 减号 |
⌘⇧- | Collapse all | 折叠所有代码块 |
Command + . |
首先光标要放在括号内,然后按下此组合键,可以在展开和折叠之间切换 | ||
Command + W |
⌘W | Close active editor tab | 关闭活动的编辑器选项卡 |
Shift+Option+上下箭头 |
⇧⌥ +上下箭头 | Move current line of code | 移动当前代码行 |
Shift + F6 |
⇧ F6 | 选中要修改的变量名称,按下此组合键,然后输入新的变量名,所有使用此变量的地方都会同步修改过来 | |
Command + Shift +8 |
⌘⇧8 | Column Selection Mode | 竖编辑模式,按下该组合键后,按住鼠标拖动选择代码,会在选中的每行出现光标,就可以一次性在不同的行插入相同的字符 |
Option + Shift + I |
⌥⇧I | Inspect current file with current profile | 使用当前的配置文件检查当前的文件,检查代码有没有问题 |
Option + Shift + I |
⌥⇧I | inspect code with editor settings | 使用编辑器设置检查代码 |
Command + S |
⌘S | Save all | 保存所有 |
IntelliJ IDEA for Mac在MacOS模式下的编辑快捷键(Editing Shortcut)
猜你喜欢
转载自blog.csdn.net/liaowenxiong/article/details/120228777
今日推荐
周排行