http://blog.csdn.net/dc_726/article/details/9531281
花了一天时间熟悉IDEA的各种操作,将各种快捷键都试了一下,感觉很是不错!于是就整理了一下我经常用的一些Eclipse快捷键与IDEA的对比,方便像我一样使用Eclipse多年但想尝试些改变的同学们。另外推荐个IDEA必装插件Key Promoter ,对于你没用快捷键的操作它都会立即提示对应的快捷键,十分强大。IDEA比较惊艳的一些快捷键我都高亮了,想了解其中的神奇,就装一个IDEA亲自尝试下吧!
分类 | 功能点 | Eclipse快捷键 | IDEA快捷键 |
搜索 | 搜索文本 | Ctrl + F | Ctrl + F Ctrl + R 查找替换 Alt + P/A 逐个/全部替换 Alt + F3 查找当前选中词 |
继续搜索 | Ctrl + K 向前 Ctrl + Shift + K 向后 | F3 Shift + F3 | |
搜索方法 | Ctrl + O | Ctrl + F12 | |
搜索类 | Ctrl + Shift + T | Ctrl + N | |
搜索文件 | Ctrl + Shift + T | Ctrl + Shift + N 这两个都支持简单的正则表达式,还支持直接按大写字母的缩略,例如: 查找JsonTranscoder,只需要输入JT | |
搜索所有引用处 | Ctrl + Alt + H | Alt + F7 | |
搜索所有文本出现的位置 | Ctrl + H | Ctrl + Shift + F | |
编辑 | 自动代码补全 | Alt + / | Ctrl + J |
自动代码生成 |
| Alt + Insert | |
快速修复错误 | Ctrl + 1 | Alt + Enter | |
删除当前行 | Ctrl + D | Ctrl + X | |
复制到下一行 |
| Ctrl + D | |
注释/取消注释 | Ctrl + / | Ctrl + / | |
选中当前字 |
| Ctrl + W
| |
补全当前行 |
| Ctrl + Shift + Enter 神器,补全当前行,最常用的场景时补全当前行后的;号,并将光标定位到下一行 | |
调出最近复制的N份内容 |
| Ctrl + Shift + V | |
查看最近编辑的文件 |
| Ctrl + E | |
对比最近修改 |
| Alt + Shift + C | |
格式化代码 | Ctrl + Shift + F | Ctrl + Alt + L | |
整理import | Ctrl + Shift + O | Ctrl + Alt + O | |
跳转 | 显示方法层次 |
| Ctrl + Shift + H |
显示类、方法说明 | F2 | Ctrl + Q | |
跳到方法定义处 |
| Ctrl + B | |
跳到方法实现处 |
| Ctrl + Alt + B | |
跳到上/下一方法 |
| Alt + Up/Down | |
上/下一查看处 | Alt + <- Alt + -> | Ctrl + Alt + Up/Down | |
跳到指定行 | Ctrl + L | Ctrl + G | |
重构 | 改名 | Alt + Shift + R | Shift + F6 |
其他常用 |
| Ctrl + F6 修改方法签名 Ctrl + Shift + F6 修改参数的类型 Ctrl + Shift + V引入局部变量 Ctrl + Shift + P 引入参数 Ctrl + Shift + F 引入类变量 Ctrl + Shift + M 引入方法 Ctrl + Shift + C 引入常量 | |
运行 | 启动调试 |
| Alt + Shift + F9 |
启动运行 |
| Alt + Shift + F10 | |
单步进入 | F5 | F7 | |
单步跳过 | F6 | F8 | |
跳过 | F8 | F9 | |
执行选中语句 |
| Alt + F8 | |
窗口 | 调出界面 |
| Ctrl + Alt + S调出Settings界面 Ctrl + Alt + Shift + S调出项目Setting界面 |
关闭界面 |
| Ctrl + F4 或 ESC | |
打开窗口 |
| Alt + 窗口编号(例如项目窗口编号是1) | |
最大化窗口 | Ctrl + M | Ctrl + Shift + F12 | |
隐藏窗口 |
| Shift + ESC | |
关闭当前文件 |
| Ctrl + F4 | |
垂直分屏 |
| Ctrl + | (自定义的) | |
调整窗口位置 |
| Ctrl + M 将当前光标处显示到屏幕中央 | |
切换窗口 |
| Ctrl + Tab |
https://www.catalysts.cc/wissenswertes/intellij-idea-and-eclipse-shortcuts/
After around seven years of exclusively using Eclipse for Java development I recently got the chance to work on a project where IntelliJ IDEA is the standard editor. All of a sudden my tried and tested Eclipse keyboard shortcuts didn’t work any more. I’m still in the process of learning the IntelliJ Shortcuts but here are my favourites up to now (with equivalent Eclipse shortcuts). This may be of help to anyone else switching over from Eclipse to IntelliJ. Of course, there is an IntelliJ Plugin available which makes IntelliJ IDEA behave like Eclipse (same shortcuts and compiler behaviour) but why do that?
In the table below, in some cases, the shortcuts do not map 1:1 but they achieve the same effect.
Eclipse | IntelliJ IDEA | Description |
F4 | ctrl+h | show the type hierarchy |
ctrl+alt+g | ctrl+alt+F7 | find usages |
ctrl+shift+u | ctrl+f7 | finds the usages in the same file |
alt+shift+r | shift+F6 | rename |
ctrl+shift+r | ctrl+shift+N | find file / open resource |
ctrl+shift+x, j | ctrl+shift+F10 | run (java program) |
ctrl+shift+o | ctrl+alt+o | organize imports |
ctrl+o | ctrl+F12 | show current file structure / outline |
ctrl+shift+m | ctrl+alt+V | create local variable refactoring |
syso ctrl+space | sout ctrj+j | System.out.println(„“) |
alt + up/down | ctrl + shift + up/down | move lines |
ctrl + d | ctrl + y | delete current line |
??? | alt + h | show subversion history |
ctrl + h | ctrl + shift + f | search (find in path) |
„semi“ set in window-> preferences | ctrl + shift + enter | if I want to add the semi-colon at the end of a statement |
ctrl + 1 or ctrl + shift + l | ctrl + alt + v | introduce local variable |
alt + shift + s | alt + insert | generate getters / setters |
ctrl + shift + f | ctrl + alt + l | format code |
ctrl + y | ctrl + shift + z | redo |
ctrl + shift + c | ctrl + / | comment out lines (my own IDEA shortcut definition for comment/uncomment on german keyboard layout on laptop: ctrl + shift + y) |
ctrl + alt + h | ctrl + alt + h (same!) | show call hierarchy |
none ? | ctrl + alt + f7 | to jump to one of the callers of a method |
ctrl + shift + i | alt + f8 | evaluate expression (in debugger) |
F3 | ctrl + b | go to declaration (e.g. go to method) |
ctrl + l | ctrl + g | go to line |