table of Contents
First, the key symbol on the Mac
symbol | Explanation |
---|---|
⌥ | option / alt |
⇧ | shift |
⌃ | control |
⌘ | command |
⎋ | esc |
Second, shortcut keys
Find / view
hot key | Explanation |
---|---|
双击 shift |
Search for anything |
command + F / command + R |
Current file Find / Replace, using command + G, shift + command + G, variable skip next / previous highlighted |
command + shift + F / command + shift + R |
Global Find / Replace |
command + O |
Global search category |
command + option + O |
Global search class / method / parameter |
option + fn + F7 / command + mouse click | Class / method references situation in the global project (see method / variable / attribute whom call) |
command + fn + F7 | Class / method in the case where the current file reference |
control + option + H | Method is called hierarchy |
command + option + B |
View implementation of the interface |
command + U |
Jump to superclass |
command + [ / ] 或 command + option + ← / → | Return to the last edit location |
command + P |
List of valid parameter range function method |
fn + F2 | Jump to errors or warnings |
fn + F1 | Notes document viewing class / method |
Control operations related
hot key | Explanation |
---|---|
command + option + L |
All current class's code format |
control + option + O |
Clear invalid package references |
command + option + T | Surround with quickly call if, for, try ... catch, while surrounded by other codes |
command + J | Quickly generate template code blocks, such as if, while, return |
command + N |
Quickly generate getter / setter method, constructor, toString () method |
command + shift + enter | End of the line to automatically add a semicolon, if automatic back "() {}" |
control + O |
Introduction method override the parent class |
control + I |
Realized interface or abstract class methods |
command + / |
Notes and canceled a commentary effect // ... |
command + option + / |
Notes and canceled a commentary effect / ... / |
option + return | Next intent guess |
command + option + < | Return to the last cursor |
option + shift + up/down | Vertical movement Code |
command + shift + up/down | The upper and lower lines of code conversion |
option + ← / → | Word or between hump jump |
command + shift + U | Change case |
control + tab | 切换文件 |
option + up/down | 选择区域,注:如果光标停留在大括号处,则选中整个大括号区域 |
command + + / command + - | 局部代码块展开/收缩 |
command + shift + + / command + shift + - | 全部代码块展开/收缩 |
command + Z / command + shift + Z | 撤销/取消撤销 |
command + C / command + delete | 删除行 |
command + D | 复制行 |
control + shift + J | 合并行 |
option + 鼠标选框 | 列编辑 |
control + option + I | 自动缩进对齐 |
command + , | 打开设置 |
shift + esc | 隐藏窗口 |
代码重构相关
快捷键 | 说明 |
---|---|
fn + shift + F6 | 类名/方法名/变量名 重命名操作 |
command + option + M | 方法重构,方法抽离 |
command + option + P | 抽离成方法参数 |
command + option + V | 抽离为局部变量 |
command + option + F | 抽离为成员变量 |
command + option + C | 把一个局部变量修改成final static 的全局常量 |