Android studio每次打开的时候就会给一个快捷键的使用,只需要花点时间记一下。我将快捷键的使用记录下来当一个笔记,也希望对大家有一点点帮助。基本都是常用的,可能有些快捷键没有,持续更新。
功能描述 | keymap对应名字 | Mac | Win/Linux | AS配置界面 Preferences command + , control + alt + s 项目配置界面 Project Structure command + ; control + alt + shift + s 代码提示 Completion/Basic control+space control + space 代码错误提示解决方案 Show Intention Action option + enter alt + enter 代码快速构成 Code Generate command+N alt + insert 代码注释 Comment With Line Comment command + / control + / 代码多行注释 Comment With Line Comment command + option + / control + alt + / 代码去除无效包引用 Option Import control+ option + o control + alt + o 代码格式化 Reformat Code command + option + L control + alt + L 代码补全 Complete Current Statement command + shift +enter control + shift + enter 代码使用模版包裹 Surround With Live Template command + option + J control + alt +J 代码使用if/try Surround With… command + option + T control + alt + T 代码生成模版 Insert Live Template command + J control + J 复制 Copy command + C control + C 粘贴 Paste command + V control + V 快捷向下复制行 Duplicate Line or Block command + D control + D 删除行 Delete Line command + delete control + Y 剪切(删除用更方便) Cut Line command + X control + X 代码折叠/展开 Collapse/Expand command + 减号/加号 control + 减号/加号 窗口呢所有代码折叠/展开 Collapse/Expand All command + shift + 减号/加号 control + shift + 减号/加号 查找文本 Edit/Find command + F control + F 查找类 Navigate/Class command + O control + N 查找文件 Navigate/File command + shift + O control + shift + N 快捷最近打开 Recent Files command + E control + E 查看声明 Declaration command + B control + B 定位到行 Navigate/Line command + L control + L 快速到行首/尾 Move Caret to Line Start/End command + Left/Right control + Left/Right 提示参数类型 Parameter Info command + P control + P 方法的跟进 command + B control + alt + B 重命名 Rename shift + F6 Shift + F6 抽取变量 Extract Variable command + option + V control + alt + V 抽取方法 Extract Method command + option + M control + alt + M 抽取字段 Extract Field command + option + F control + alt + F 抽取常量 Extract Constant Command + option + C control + alt + C 抽取参数 Extract Parameter Command + option + P control + alt + P 重构入口 Refactor This control + T control + alt + shift + T 显示类关系继承体系 Type Hierarchy control + H control + H 快速复写方法 Override Methods control + o control + o 查找调用的地方 Call Hierarchy control + option + H control + alt + H 预览方法定义 Quick Definition command + Y control + shift + I