Android Studio常用快捷键




常用快捷键

Ctrl + P 方法调用的参数说明 | Parameter info (within method call arguments)
Ctrl + Q 快速查找文档 | Quick documentation lookup
Ctrl + mouse over code 显示代码的简明信息 | Brief Info
Ctrl + Alt + T 用(if..else, try..catch, for,synchronized, etc)包围代码 | Surround with… (if..else, try..catch, for,synchronized, etc.)
Ctrl + / 注释/取消注释行  |  Comment/uncomment with line comment
Ctrl + Shift + / 注释/取消注释代码块| Comment/uncomment with block comment
Ctrl + Alt + L 对代码格式化 | Reformat code
Ctrl + Alt + I 自动缩进行 | Auto-indent line(s)
Shift + Enter 另起一行(和enter不同,不管光标在一行的什么位置。) | Start new line
Ctrl + Shift + U 切换选择的代码块的大小写 | Toggle case for word at caret or selected block
Ctrl + NumPad+/- 展开/折叠代码块 | Expand/collapse code block
Ctrl + F 在文件里搜索|Find
Ctrl + R 在文件里替换 | Replace
Shift + F10 运行项目 | Run
Shift + F9 调试项目 | Debug
F8 单步执行 | Step over
F7 跳入方法执行 | Step into
Shift + F8 单步跳出|Step out
Alt + F9 运行到断点 | Run to cursor
Alt + F8 显示表达式的值| Evaluate expression
Ctrl + Shift + F8 查看断点 | View breakpoints
Ctrl + Shift + N 定位到文件 | Go to file
Ctrl + G 跳转到行 | Go to line
Ctrl + E 最近打开的文件|Recent files popup
Ctrl + B , Ctrl + Click 转到声明 | Go to declaration
F2 / Shift + F2 高亮显示下一个/前一个错误 | Next/previous highlighted error
Alt + Shift + F 添加到收藏 | Add to Favorites
Ctrl + Alt + S 打开设置对话框 | Open Settings dialog

全部快捷键

IntelliJ IDEA Default Keymap (android studio默认的快捷键)

Editing 编辑

Ctrl + Space基本代码完善(任何类,方法,变量),也就是智能提示 | Basic code completion (the name of any class, method or variable)
Ctrl + Shift + Space 智能代码补全(过滤器的方法和变量的预期类型列表) | Smart code completion (filters the list of methods and variables by expected type)
Ctrl + Shift + Enter 补全当前语句 | Complete statement (直接按enter健一样的效果)
Ctrl + P 方法调用的参数说明 | Parameter info (within method call arguments)
Ctrl + Q 快速查找文档 | Quick documentation lookup
Shift + F1 外部文档 | External Doc
Ctrl + F1 在插入符号显示的描述错误或警告 | Show descriptions of error or warning at caret
Ctrl + mouse over code 显示代码的简明信息 | Brief Info
Alt + Insert 生成代码(Getters, Setters, Constructors,hashCode/equals, toString) | Generate code… (Getters, Setters, Constructors,hashCode/equals, toString)
Ctrl + O 重载方法 | Override methods
Ctrl + I 实现了该方法的方法 | Implement methods
Ctrl + Alt + T 用(if..else, try..catch, for,synchronized, etc)包围代码 | Surround with… (if..else, try..catch, for,synchronized, etc.)
Ctrl + / 注释/取消注释行  |  Comment/uncomment with line comment
Ctrl + Shift + / 注释/取消注释代码块| Comment/uncomment with block comment
Ctrl + W 选择相关联的代码块 | Select successively increasing code blocks
Ctrl + Shift + W 取消选择相关联的代码块| Decrease current selection to previous state
Alt + Q 上下文信息 | Context info
Alt + Enter 意图操作 | Show intention actions and quick-fixes
Ctrl + Alt + L 对代码格式化 | Reformat code
Ctrl + Alt + O 调整导入为最佳 | Optimize imports
Ctrl + Alt + I 自动缩进行 | Auto-indent line(s)
Tab / Shift + Tab 缩进/不缩进选择的行 | Indent/unindent selected lines
Ctrl + X , Shift + Delete 剪切选择的块 |Cut current line or selected block to clipboard
Ctrl + C , Ctrl + Insert 复制选择的块|Copy current line or selected block to clipboard
Ctrl + V , Shift + Insert 粘贴 | Paste from clipboard
Ctrl + Shift + V 从最近的缓存的粘贴板选择粘贴 | Paste from recent buffers…
Ctrl + D 复制当前行或者所选块并粘贴 | Duplicate current line or selected block
Ctrl + Y 删除光标所在位置行 | Delete line at caret
Ctrl + Shift + J 智能线连接 | Smart line join
Ctrl + Enter 智能线分裂 | Smart line split
Shift + Enter 另起一行(和enter不同,不管光标在一行的什么位置。) | Start new line
Ctrl + Shift + U 切换选择的代码块的大小写 | Toggle case for word at caret or selected block
Ctrl + Shift + ]/[ 选择到代码块结束/开始 | Select till code block end/start
Ctrl + Delete 删除单词结束 | Delete to word end
Ctrl + Backspace 删除单词开始 | Delete to word start
Ctrl + NumPad+/- 展开/折叠代码块 | Expand/collapse code block

查找和替换 Search/Replace

Double Shift 在项目里搜索 | Search everywhere
Ctrl + F 在文件里搜索|Find
F3 在文件里搜索|Find next
Shift + F3 搜索前一个|Find previous
Ctrl + R 在文件里替换 | Replace
Ctrl + Shift + F 找到所属的路径|Find in path
Ctrl + Shift + R 在所属的路径替换| Replace in path
Ctrl + Shift + S 搜索所属的结构 | Search structurally (Ultimate Edition only)
Ctrl + Shift + M 替换所属的结构 | Replace structurally (Ultimate Edition only)

搜索相关快捷键 Usage Search

Alt + F7 / Ctrl + F7 查找用法/查找定义方法的文件 | Find usages / Find usages in file
Ctrl + Shift + F7 高亮显示 | Highlight usages in file
Ctrl + Alt + F7 显示用法 | Show usages

编译和运行 Compile and Run

Ctrl + F9 建立项目(编译修改的和下载依赖) | Make project (compile modifed and dependent)
Ctrl + Shift + F9 编译修选中的文档,目录或模块 | Compile selected file, package or module
Alt + Shift + F10 选择配置并运行|Select configuration and run
Alt + Shift + F9 选择配置并调试 | Select configuration and debug
Shift + F10 运行项目 | Run
Shift + F9 调试项目 | Debug
Ctrl + Shift + F10 根据配置运行项目 | Run context configuration from editor

调试 Debugging

F8 单步执行 | Step over
F7 跳入方法执行 | Step into
Shift + F7 智能单步执行 | Smart step into
Shift + F8 单步跳出|Step out
Alt + F9 运行到断点 | Run to cursor
Alt + F8 显示表达式的值| Evaluate expression
F9 重新开始程序 | Resume program
Ctrl + F8 切换断点 | Toggle breakpoint
Ctrl + Shift + F8 查看断点 | View breakpoints

导航 | Navigation

Ctrl + N 定位到类 | Go to class
Ctrl + Shift + N 定位到文件 | Go to file
Ctrl + Alt + Shift + N 定位到静态变量 | Go to symbol
Alt + Right/Left 切换到左/右窗口 Go to next/previous editor tab
F12 回到以前的工具窗口 | Go back to previous tool window
Esc 从工具窗口回到编辑器 | Go to editor (from tool window)
Shift + Esc 隐藏当前或最新的工具窗口 | Hide active or last active window
Ctrl + Shift + F4 关闭选项卡 | Close active run/messages/find/… tab
Ctrl + G 跳转到行 | Go to line
Ctrl + E 最近打开的文件|Recent files popup
Ctrl + Alt + Left/Right 后退/前进导航 | Navigate back/forward
Ctrl + Shift + Backspace 向最近编辑导航 | Navigate to last edit location
Alt + F1 在任何视图选择当前文件或静态变量 Select current file or symbol in any view
Ctrl + B , Ctrl + Click 转到声明 | Go to declaration
Ctrl + Alt + B 转到实现类的文件去 | Go to implementation(s)
Ctrl + Shift + I 打开定义的文件 | Open quick definition lookup
Ctrl + Shift + B 跳转到类型定义处 | Go to type declaration
Ctrl + U 转到父类方法或超类 | Go to super-method/super-class
Alt + Up/Down 到之前或者下一个方法 | Go to previous/next method
Ctrl + ]/[ 移动光标到一块代码的开始/结尾位置 | Move to code block end/start
Ctrl + F12 弹出文件结构 | File structure popup
Ctrl + H 类的层次 | Type hierarchy
Ctrl + Shift + H 方法的层次 | Method hierarchy
Ctrl + Alt + H 调用层次 | Call hierarchy
F2 / Shift + F2 高亮显示下一个/前一个错误 | Next/previous highlighted error
F4 / Ctrl + Enter 查看定义的地方 | Edit source / View source (感觉ctrl + enter没用)
Alt + Home 光标定位到导航栏 | Show navigation bar
F11 切换(关闭/开启)书签 | Toggle bookmark
Ctrl + F11 切换记忆书签 | Toggle bookmark with mnemonic
Ctrl + #[0-9] 定位到数字书签 | Go to numbered bookmark
Shift + F11 显示书签 | Show bookmarks

代码重构 Refactoring

F5 复制文件 | Copy
F6 移动文件|Move
Alt + Delete 安全删除文件 | Safe Delete
Shift + F6 重命名 | Rename
Ctrl + F6 更改文件签名 | Change Signature
Ctrl + Alt + N 内联| Inline
Ctrl + Alt + N 提取方法 | Extract Method
Ctrl + Alt + V 提取变量 | Extract Variable
Ctrl + Alt + F 提取字段 | Extract Field
Ctrl + Alt + C 提取常亮 | Extract Constant
Ctrl + Alt + P 提取参数 | Extract Parameter

VCS 和本地版本历史 VCS/Local History

Ctrl + K 提交项目到VCS | Commit project to VCS
Ctrl + T 从VCS更新项目 | Update project from VCS
Alt + Shift + C 查看最近的改变 | View recent changes
Alt + BackQuote (`) 弹出VCS快捷菜单 | ‘VCS’ quick popup

动态模板 | Live Templates
就是一些android studio自带的代码模板,以供快速调用。
Ctrl + Alt + J 将选中的部分放在动态代码内部 | Surround with Live Template
Ctrl + J 插入动态代码 | Insert Live Template
iter Iteration according to Java SDK 1.5 style
inst Check object type with instanceof and downcast it
itco Iterate elements of java.util.Collection
itit Iterate elements of java.util.Iterator
itli Iterate elements of java.util.List
psf public static final
thr throw new

快捷键 | General

Alt + #[0-9] 打开相应的工具窗口 | Open corresponding tool window
Ctrl + S 保存 | Save all
Ctrl + Alt + Y 同步 | Synchronize
Ctrl + Shift + F12 切换最大化编辑器 | Toggle maximizing editor
Alt + Shift + F 添加到收藏 | Add to Favorites
Alt + Shift + I 检查当前文件和当前概要文件 | Inspect current file with current profile
Ctrl + BackQuote (`) 快速切换当前设置 | Quick switch current scheme
Ctrl + Alt + S 打开设置对话框 | Open Settings dialog
Ctrl + Alt + Shift + S 打开项目结构对话框 | Open Project Structure dialog
Ctrl + Shift + A 查找动作 | Find Action
Ctrl + Tab 选项卡和工具窗口切换。Switch between tabs and tool window

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值