快捷键 | 作用 | 英文名称 |
---|---|---|
Ctrl + Shift + Space | 智能代码补全 | Smart code completion |
Double⇧ | 全局搜索 | Search everywhere |
⌥↩ | 展示相关方法,新建test等 | Show intention actions and quick-fixes |
⌘P | 显示接口的参数信息 | Parameter info |
⌥↑ | 扩大选择区域 | Extend selection |
⌥↓ | 缩小选择区域 | Shrink selection |
⌘ E | 显示最近操作的文件列表 | Recent files popup |
⇧F6 | 重命名 | Rename |
general
快捷键 | 作用 | 英文名称 |
---|---|---|
⌘0...⌘9 | 打开相应工具栏 | Open corresponding tool window |
⌘S | 全局保存 | Save all |
⌘⌥Y | 同步、刷新 | Synchronize |
⌘⇧F12 | 最大化编辑区 | Toggle maximizing editor |
⌥⇧I(0) | 检查当前文件与当前的配置文件 | Inspect current file with current profile |
⌃` | 切换主题 | Quick switch current scheme |
⌘ ,(逗号) | 打开配置对话框 | Open Settings dialog |
⌘ ; | 打开项目结构对话框 | Open Project Structure dialog |
⌘ . | 折叠/展开方法 |
debugging
快捷键 | 作用 | 英文名称 |
---|---|---|
F8/F7 | F8:进入下一步,如果当前行断点是一个方法,则不进入当前方法体内 F7:进入下一步,如果当前行断点是一个方法,则进入当前方法体内,如果该方法体还有方法,则不会进入该内嵌的方法中 | Step over / into |
⇧F7/⇧F8 | 智能步入,断点所在行上有多个方法调用,会弹出进入哪个方法/跳出 | Smart step into / Step out |
⌥F9 | 运行到光标处,如果光标前有其他断点会进入到该断点 | Run to cursor |
⌥F8 | 计算表达式(可以更改变量值使其生效) | Evaluate expression |
⌘⌥R | 恢复程序运行,如果该断点下面代码还有断点则停在下一个断点上 | Resume program |
⌘F8 | 切换断点(若光标当前行有断点则取消断点,没有则加上断点) | Toggle breakpoint |
⌘⇧F8 | 查看断点信息 | View breakpoints |
search/replace
快捷键 | 作用 | 英文名称 |
---|---|---|
Double⇧ | 全局搜索 | Search everywhere |
⌘ F | 本文件搜索 | Find |
⌘ G/⌘⇧G | 搜索下一个/前一个 | Find next / previous |
⌘ R | 本文件替换 | Replace |
⌘⇧F | 根据路径查询 | Find in path |
⌘⇧R | 根据路径替换 | Replace in path |
⌃ G | 选择下一个对象,一起编辑 | Select next occurrence |
⌃ ⌘G | 本文件中所有相同的对象,一起编辑 | Select all occurrences |
⌃ G(失效) | 不选中同样的对象 | Unselect occurrence |
editing
快捷键 | 作用 | 英文名称 |
---|---|---|
⌃ Space(失效) | 现在切换输入法 | Basic code completion |
⌃⇧Space | 智能补齐代码 | Smart code completion |
⌘⇧↩︎(失效) | Complete statement | |
⌘ P | 显示接口的参数信息 | Parameter info |
⌘J, F1(太难操作了) | 快速文档查找 | Quick documentation lookup |
⇧ F1 | 查看外部文档(在某些代码上会触发打开浏览器显示相关文档) | External Doc |
⌘ + mouse | 鼠标放在代码上 显示代码简要信息 | Brief Info |
⌘ F1 | 在错误或警告处显示具体描述信息 | Show descriptions of error at caret |
⌘ N, ⌃↩︎ | 自动生成代码,get,set,tostring等等 | Generate code... |
⌃ O | 生成重写方法 | Override methods |
⌃ I | 生成实现方法 | Implement methods |
⌘ ⌥ T | 包围代码(使用if…else, try…catch, for, synchronized等包围选中的代码) | Surround with… |
⌘ / | 注释 | Comment / uncomment with line comment |
⌘ ⌥/ | 块注释 | Comment / uncomment with block comment |
⌥ ↑ | 扩大选择区域 | Extend selection |
⌥ ↓ | 缩小选择区域 | Shrink selection |
⌃⇧Q | 显示上下文信息 | Context info |
⌥ ↩ | 显示意向动作和快速修复代码 | Show intention actions and quick-fixes |
⌘⌥L | 格式化代码 | Reformat code |
⌃ ⌥ O | 优化引用 | Optimize imports |
⌃ ⌥ I | 自动缩进行 | Auto-indent line(s) |
⇥/⇧⇥ | 锁进/取消锁进 | Indent / unindent selected lines |
⌘ X | 剪切 | Cut current line to clipboard |
⌘ C | 复制 | Copy current line to clipboard |
⌘ V | 粘贴 | Paste from clipboard |
⌘⇧V | 从最近的缓冲区粘贴 | Paste from recent buffers... |
⌘D | 复制当前行 | Duplicate current line |
⌘⌨ | 删除当前行 | Delete line at caret |
⌃⇧J | 智能的将代码拼接成一行 | Smart line join |
⌘↩ | 智能的拆分拼接的行 | Smart line split |
⇧↩ | 开始新的一行 | Start new line |
⌘⇧U | 在插入符号或选定块处切换单词的大小写 | Toggle case for word at caret or selected block |
⌘⌥⇧[/⌘⌥⇧](失效) | 选择直到代码块结束 / 开始 | Select till code block end / start |
⌥ ⌦ | 删除到单词的结尾 | Delete to word end |
⌥ ⌨ | 删除到单词的开头 | Delete to word start |
⌘ +/⌘ - | 展开 / 折叠代码块 | Expand / collapse code block |
⌘⇧+ | 展开所有 | Expand all |
⌘⇧- | 折叠所有 | Collapse all |
⌘W | 关闭活动的编辑页 | Close active editor tab |
refactoring
快捷键 | 作用 | 英文名称 |
---|---|---|
F5 | 复制其他路径下 | Copy |
F6 | 移动到其他路径下 | Move |
⌘Delete | 安全删除 | Safe Delete |
⇧F6 | 重命名 | Rename |
⌃T | 重构这个文件 | Refactor this |
⌘F6(不懂) | 更改签名 | Change Signature |
⌘⌥N(不懂) | 排队 | Inline |
⌘⌥M | 所选择的代码生成一个方法 | Extract Method |
⌘⌥V | 提取变量 | Extract Variable |
⌘⌥F | 提取字段 | Extract Field |
⌘⌥C | 提取常数 | Extract Constant |
⌘⌥P | 提取参数 | Extract Parameter |
navigation
快捷键 | 作用 | 英文名称 |
---|---|---|
⌘O | 找到类 | Go to class |
⌘⇧O | 找到文件 | Go to file |
⌘⌥O | 前往指定的变量 / 方法 | Go to symbol |
⌃←/⌃→(切换页面了) | 转到下一个 / 上一个编辑器选项卡 | Go to next / previous editor tab |
F12 | 返回上一个工具窗口 | Go back to previous tool window |
⎋(找不到这个按键) | Go to editor (from tool window) | |
⇧⎋(找不到这个按键) | Hide active or last active window | |
⌘ L | 找到所在的行 | Go to line |
⌘ E | 显示最近打开的文件记录列表 | Recent files popup |
⌘⇧E | 最近的位置弹出窗口 | Recent locations popup |
⌘⌥←/⌘⌥→ | 向后导航 / 向前 | Navigate back / forward |
⌘⇧⌨ | 导航到上次编辑位置 | Navigate to last edit location |
⌥ F1 | 在任何视图中选择当前文件或符号 | Select current file or symbol in any view |
⌘B, ⌘Click | 前往声明(前往接口) | Go to declaration |
⌘ ⌥ B | 前往实现类 | Go to implementation(s) |
⌥Space, ⌘Y | 打开快速定义查找 | Open quick definition lookup |
⌃⇧B | 转到类型声明 | Go to type declaration |
⌘ U | 前往当前光标所在方法的父类的方法 / 接口定义 | Go to super-method / super-class |
⌃↑/⌃↓ | 前/后一个方法 | Go to previous / next method |
⌘ ⌥ [ / ⌘ ⌥ ] | 到代码块起点/终点 | Move to code block end / start |
⌘ F12 | 文件结构弹出窗口 | File structure popup |
⌃H | 类型层次 | Type hierarchy |
⌘⇧H | 方法层次结构 | Method hierarchy |
⌃⌥H | 调用层次结构 | Call hierarchy |
F2/⇧F2 | 下一个 / 上一个突出显示的错误 | Next / Previous highlighted error |
F4/⌘ ↓ | 编辑源 / 查看源 | Edit source / View source |
⌥ Home | 显示导航栏 | Show navigation bar |
F3 | 切换书签 | Toggle bookmark |
⌥ F3 | 使用助记符切换书签 | Toggle bookmark with mnemonic |
campile and run
快捷键 | 作用 | 英文名称 |
---|---|---|
⌘ F9 | 编译 | Build project |
⌘⇧F9 | 编译选定的文件、包或模块 | Compile selected file, package or module |
⌃⌥R/D | 选择配置并运行 / 调试 | Select configuration and run / debug |
⌃R/D | Run / Debug | |
⌃⇧R, ⌃⇧D | 从编辑器运行上下文配置 | Run context configuration from editor |
Double ⌃ | Run anything |
usage search
快捷键 | 作用 | 英文名称 |
---|---|---|
⌥F7/⌘F7 | 查找用法 / 在文件中查找用法 | Find usages / Find usages in file |
⌘⇧F7 | 突出显示文件中的用法 | Highlight usages in file |
⌘⌥F7 | 对话框显示用法 | Show usages |
VCS/LOCAL HISTORY
快捷键 | 作用 | 英文名称 |
---|---|---|
⌘K | git 提交 | 将项目提交到 VCS |
⌘T | 更新 | Update project from VCS |
⌘⇧K | push | Push commits |
live templates
快捷键 | 作用 | 英文名称 |
---|---|---|
⌘⌥J | 用实时模板环绕 | Surround with Live Template |
⌘J | 插入实时模板 | Insert Live Template |