用的最多的快捷键 ctrl+shift+A 哪里不会点哪里。。
idea常用快捷键
General
| No. | shortcut | search key |
|---|---|---|
| Alt+1 | 项目 | |
| Alt+2 | 收藏 | |
| Alt+6 | TODO | |
| Alt+7 | 结构 | |
| Ctrl+~ | 快速切换方案(界面外观、代码风格、快捷键映射等菜单) | |
| Shift+F12 | 还原默认布局 | |
| Ctrl+Shift+F12 | 隐藏/恢复所有窗口 | |
| Ctrl+F4 | 关闭 | |
| Ctrl+Shift+F4 | 关闭活动选项卡 | |
| Ctrl+Tab | 转到下一个拆分器 | |
| Ctrl+Shift+Tab | 转到上一个拆分器 | |
| Ctrl+E | 最近打开的文件 | |
| Ctrl+Shift+E | 最近更改的文件 | |
| Ctrl+F12 | 显示当前文件的结构 | |
| Ctrl+N | 按照文件名,打开java文件 | |
| Ctrl+Shift+N | 打开文件 | |
| Ctrl+P | 以显示参数信息 | |
| Ctrl+Q | 显示javadoc信息 | |
| Alt+Insert | 可以生成构造器/Getter/Setter等 | |
| Ctrl+Enter | 自动修正导入包 | |
| Ctrl+Alt+L | 格式化代码 | |
| Ctrl+Alt+O | 优化导入的类和包 | |
| Ctrl+R | 替换文本 | |
| Ctrl+Shift+Space | 自动补全代码 | |
| Ctrl+空格 | 代码提示 | |
| Alt+Shift+C | 最近的更改 | |
| Alt+Shift+Up/Down | 上/下移一行 | |
| shift+F6 | 重命名 | |
| Ctrl+Y | 删除行 | |
| Ctrl+D | 复制行 | |
| Ctrl+/或Ctrl+Shift+/ | 注释(//或者/**/) | |
| Ctrl+J | 选择代码模版 | |
| Ctrl+Alt+J | 环绕行代码模版 | |
| Ctrl+H | 显示类结构图(类的继承层次) | |
| Alt+F1 | 查找代码,项目中位置,磁盘中位置等 | |
| Alt+1 | 快速打开或隐藏工程面板 | |
| Ctrl+Alt+left/right | 返回至上次浏览的位置 | |
| Alt+left/righ | 切换代码视图 | |
| Alt+Up/Down | 在方法间快速移动定位 | |
| Ctrl+Shift+Up/Down | 向上/下移动语句 | |
| F2 或 Shift+F2 | 高亮错误或警告快速定位 | |
| Ctrl+B/Ctrl+Click | 快速打开光标处的类或方法(跳转到定义处) | |
| Ctrl+Alt+B | 跳转到方法实现处 | |
| Ctrl+Shift+Backspace | 跳转到上次编辑的地方 | |
| Ctrl+O | 重写方法 | |
| Ctrl+Alt+Space | 类名自动完成 | |
| Ctrl+Alt+Up/Down | 快速跳转搜索结果 | |
| Shift+Esc | 把焦点移到编辑器上,而且还可以隐藏当前(或最后活动的)工具窗口 | |
| F12 | 把焦点从编辑器移到最近使用的工具窗口 | |
| Ctrl+W | 可以选择单词继而语句继而行继而函数 | |
| Ctrl+Shift+U | 大小写转化 | |
| Ctrl+Alt+S | 打开设置对话框 | |
| Ctrl+Alt+Shift+S | 当前项目/模块属性 | |
| Ctrl+G | 定位行 | |
| Ctrl+”+/-“ | 当前方法展开、折叠 | |
| Ctrl+Shift+”+/-“ | 全部展开、折叠 |
调试部分、编译
| No. | shortcut | search key |
|---|---|---|
| Ctrl+F2 | 停止服务 | |
| Alt+Shift+F9 | 选择 Debug | |
| Alt+Shift+F10 | 选择 Run | |
| Ctrl+F9 | 生成项目(编译修改过的) | |
| Ctrl+Shift+F9 | 编译 | |
| Ctrl+Shift+F10 | 运行 | |
| Ctrl+Shift+F8 | 查看断点 | |
| F8 | 步过 | |
| F7 | 步入 | |
| Shift+F7 | 智能步入 | |
| Shift+F8 | 步出 | |
| F9 | 恢复程序 | |
| Alt+F10 | 定位到断点 | |
| Ctrl+F8 | 切换行断点 |
重构
| No. | shortcut | search key |
|---|---|---|
| Ctrl+Alt+Shift+T | 弹出重构菜单 | |
| Shift+F6 | 重命名 | |
| F6 | 移动 | |
| F5 | 复制 | |
| Alt+Delete | 安全删除 | |
| Ctrl+Alt+N | 内联 |
查找
| No. | shortcut | search key |
|---|---|---|
| Ctrl+F | 查找 | |
| Ctrl+R | 替换 | |
| F3 | 查找下一个 | |
| Shift+F3 | 查找上一个 | |
| Ctrl+Shift+F | 在路径中查找 | |
| Ctrl+Shift+R | 在路径中替换 | |
| Ctrl+Shift+S | 搜索结构 | |
| Ctrl+Shift+M | 替换结构 | |
| Alt+F7 | 查找用法 | |
| Ctrl+Alt+F7 | 显示用法 | |
| Ctrl+F7 | 在文件中查找用法 | |
| Ctrl+Shift+F7 | 在文件中高亮显示用法 |
VCS
| No. | shortcut | search key |
|---|---|---|
| Alt+~ | VCS 操作菜单 | |
| Ctrl+Alt+Y | 同步 | |
| Ctrl+K | 提交更改 | |
| Ctrl+T | 更新项目 | |
| Ctrl+Alt+Shift+D | 显示变化 |
idea常用快捷键备忘与eclipse的对比
Templates shortcut(模版)
| Template | Eclipse | IntelliJ IDEA | search key |
|---|---|---|---|
| Define a main method | main | psvm | main方法 |
| terate over an array | for | itar | |
| Iterate over a collection | for | itco | |
| Iterate over a list | for | itli | |
| Iterate over an iterable using foreach syntax | foreach | iter | |
| Print to System.out | sysout | sout | |
| Print to System.err | syserr | serr | |
| Define a static field | static_final | psf | 静态常量 |
Navigation(导航)
| Eclipse | IntelliJ IDEA | |||
|---|---|---|---|---|
| Action | Shortcut | Action | Shortcut | search key |
| Quick access | Ctrl+3 | Search everywhere | Shift x 2 | 全局,文件名,everything |
| Open type | Ctrl+Shift+T | Navigate to class | Ctrl+N | 全局,java文件 |
| Open resource | Ctrl+Shift+R | Navigate to file | Ctrl+Shift+N | 全局,文件名 |
| - | - | Navigate to symbol | Ctrl+Shift+Alt+N | 变量名,方法名,类名 |
| Quick switch editor | Ctrl+E | Switcher | Ctrl+Tab | 切换器,切换窗口 |
| - | - | Recent files | Ctrl+E | 切换到最近打开的文件 |
| Open declaration | F3 | Navigate to declaration | Ctrl+B | 跳转到定义点 |
| Open type hierarchy | F4 | Navigate to type hierarchy | Ctrl+H | |
| - | - | Show UML popup | Ctrl+Alt+U | 展示结构 |
| Quick outline | Ctrl+O | File structure | Ctrl+F12 | 文件结构,方法名 |
| Back | Ctrl+[ | Back | Ctrl+Alt+Left | 返回到鼠标上次定位的地方 |
| Forward | Ctrl+] | Forward | Ctrl+Alt+Right | 前进到下次定位点 |
Refactorings(重构)
| Eclipse | IntelliJ IDEA | search key | ||
|---|---|---|---|---|
| Action | Shortcut | Action | Shortcut | |
| Extract local variable | Ctrl+Alt+L | Extract variable | Ctrl+Alt+V | 提取变量 |
| Assign to field | Ctrl+2 | Extract field | Ctrl+Alt+F | |
| Show refactor quick menu | Ctrl+Alt+T | Rafactor this | Ctrl+Shift+Alt+T | |
| Rename | Ctrl+Alt+R | Rename | Shift+F6 | 重命名 |
search(检索)
| Eclipse | IntelliJ IDEA | |||
|---|---|---|---|---|
| Action | Shortcut | Action | Shortcut | 关键字 |
| Open search dialog | Ctrl+H | Find in path | Ctrl+Shift+F | 检索,选中文字 |
| References in workspace | Ctrl+Shift+G | Find usages | Alt+F7 | 检索,选中文字 |
| - | - | Show usages | Ctrl+Alt+F7 | 检索,选中文字,弹窗 |
| - | - | Find usages settings | Ctrl+Shift+Alt+F7 | 检索,选中文字,可设置 |
| Occurrences in file | Ctrl+Alt+U | Highlight usages in file | Ctrl+F7 |
Code formatting(格式化)
| Eclipse | IntelliJ IDEA | |||
|---|---|---|---|---|
| Action | Shortcut | Action | Shortcut | 关键字 |
| Format | Ctrl+Shift+F | Reformat code | Ctrl+Alt+L | 格式化,代码 |
Running and reloading changes(启动项目)
| Eclipse | IntelliJ IDEA | |||
|---|---|---|---|---|
| Action | Shortcut | Action | Shortcut | 关键字 |
| Run | Ctrl+Shift+F11 | Run | Shift+F10 | 启动 |
| Debug | Ctrl+F11 | Debug | Shift+F9 | debug,启动 |
| - | - | Make | Ctrl+F9 | 部署 |
| - | - | Update application | Ctrl+F10 | 更新 |
Debugging(debug项目)
| Eclipse | IntelliJ IDEA | |||
|---|---|---|---|---|
| Action | Shortcut | Action | Shortcut | 关键字 |
| Step into | F5 | Step into | F7 | 步入 |
| - | - | Smart step into | Shift+F7 | 智能步入 |
| Step over | F6 | Step over | F8 | 下一行,步过 |
| Step out | F7 | Step out | Shift+F8 | 步出 |
| Resume | F8 | Resume | F9 | 下一断点 |
| Toggle breakpoint | Ctrl+Shift+B | Toggle breakpoint | Ctrl+F8 | 切换行断点 |
| - | - | Evaluate expression | Alt+F8 |
参考
[http://www.cnblogs.com/tonycody/p/3257601.html][TONY | 小四博客]
[https://www.jetbrains.com/help/idea/2016.1/eclipse.html#CodingAssistance][idea帮助页]