快捷键快捷键符号英文名称功能说明
Control + Space
⌃SpaceBasic code completion基本的代码补全(补全任何类、方法、变量),代码智能提示,因为和切换输入法快捷键冲突,所以基本改成Alt+/
Shift + Command + Enter
⌘⇧↩Complete statement自动结束代码,行末自动添加分号Command + P
⌘PParameter info (within method call arguments)显示方法的参数信息Control + J /F1 /Control+click
⌃J / F1/ ⌃+clickQuick documentation lookup显示当前位置的变量、方法的 Documentation 内容, 快速查看文档Shift + F1
⇧F1External Doc查看外部文档(在某些代码上会触发打开浏览器显示相关文档)Command + 鼠标放在代码上
⌘ + mouseBrief Info显示代码简要信息Command + F1
⌘F1Error Description在错误或警告处显示具体描述信息Command + N, Control + Enter
⌘N, ⌃↩, ⌃NGenerate code…生成代码(getter、setter、构造函数、hashCode/equals,toString)Control + O
⌃OOverride methods覆盖方法(重写父类方法)Control + I
⌃IImplement methods实现方法(实现接口中的方法)Option + Command + T
⌥⌘TSurround with…包围代码(使用if…else, try…catch, for, synchronized等包围选中的代码)Option + 方向键上
⌥↑Extend selection连续选中代码块Option + 方向键下
⌥↓Shrink selection减少当前选中的代码块Control + Shift + Q
⌃⇧QContext info显示上下文信息Command + Option + L
⌘⌥LReformat code格式化代码Control + Option + O
⌃⌥OOptimize imports优化importControl + Option + I
⌃⌥IAuto-indent line(s)自动缩进线Tab / Shift + Tab
⇥ / ⇧⇥Indent/unindent selected lines缩进代码 / 反缩进代码Command + X
⌘XCut current line to clipboard剪切当前行或选定的块到剪贴板Command + C
⌘CCopy current line to clipboard复制当前行或选定的块到剪贴板Command + V
⌘VPaste from clipboard从剪贴板粘贴Command + Shift + V
⌘⇧VPaste from recent buffers…从最近的缓冲区粘贴Command+D
⌘DDuplicate current line复制光标所在行的内容,插入光标所在行下面Command + Delete
⌘⌫Delete line at caret删除当前行或选定的块的行Control + Shift + J
⌃⇧JSmart line join智能的将代码拼接成一行Command + Enter
⌘↩Smart line split智能行拆分Option + Enter
⌥↩Show intention actions and quick-fixes显示意向动作/快速修复代码Shift + Enter
⇧↩光标所在行下方插入空白行Option + Command + Enter
⌥⌘↩光标所在行上方插入空白行Command + Shift + U
⌘⇧UToggle case for word at caret or selected block大小写切换Shift+Command+]
⇧⌘]select next tab选择下个tabShift+Command+[
⇧⌘[select previous tab选择上一个tabCommand + 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
⌘WClose active editor tab关闭活动的编辑器选项卡Shift+Option+上下箭头
⇧⌥ +上下箭头Move current line of code移动当前代码行Shift + F6
⇧ F6选中要修改的变量名称,按下此组合键,然后输入新的变量名,所有使用此变量的地方都会同步修改过来Command + Shift +8
⌘⇧8Column Selection Mode竖编辑模式,按下该组合键后,按住鼠标拖动选择代码,会在选中的每行出现光标,就可以一次性在不同的行插入相同的字符Option + Shift + I
⌥⇧IInspect current file with current profile使用当前的配置文件检查当前的文件,检查代码有没有问题Option + Shift + I
⌥⇧Iinspect code with editor settings使用编辑器设置检查代码Command + S
⌘SSave all保存所有