Android Studio 快捷键大全(Mac系统)

一、Mac上的按键符号

符号说明
option / alt
shift
control
command
esc

二、快捷键

查找/查看相关

快捷键说明
双击 shift搜索任意内容
command + F / command + R当前文件查找/替换,使用command + G,shift + command + G,跳到下一个/上一个高亮的变量
command + shift + F / command + shift + R全局查找/替换
command + O全局搜索类
command + option + O全局搜索类/方法/参数
option + fn + F7 / command + 鼠标点击类/方法在全局项目中引用情况(查看方法/变量/属性被谁调用了)
command + fn + F7类/方法在当前文件中引用情况
control + option + H方法被调用层级结构
command + option + B查看接口的实现
command + U跳转至超类的方法
command + [ / ] 或 command + option + ← / →返回到上次编辑位置
command + P列出函数方法一系列的有效参数
fn + F2跳转至错误或警告
fn + F1查看类/方法的注释文档

控制操作相关

快捷键说明
command + option + L当前类的所有代码进行格式化
control + option + O清除无效包引用
command + option + TSurround with快速调出if,for,try…catch,while等环绕代码
command + J快速生成模版代码块,如if,while,return
command + N快速生成getter/setter方法,构造方法,toString()方法等
command + shift + enter行尾自动添加分号,if后面自动加“(){ }”
control + O引入重写父类的方法
control + I引入接口或抽象类方法的实现
command + /注释与取消注释,注释效果 //…
command + option + /注释与取消注释,注释效果 /…/
option + return下一步意图猜测
command + option + <返回上次光标处
option + shift + up/down上下移动代码
command + shift + up/down上下代码行换位
option + ← / →单词间或驼峰间跳转
command + shift + U切换大小写
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 的全局常量
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值