IDEA常用快捷键
1、通用操作
描述 | 快捷键 |
---|---|
复制代码-copy | ctrl + c |
粘贴-paste | ctrl + v |
剪切-cut | ctrl + x |
撤销-undo | ctrl + z |
反撤销-redo | ctrl + shift + z |
保存-save all | ctrl + s |
全选-select all | ctrl + a |
2、提高编码速度
描述 | 快捷键 |
---|---|
智能代码提示-edit | alt + enter |
提示代码模板-insert live template | ctrl + j |
使用xx块环绕-surround with … | ctrl + alt + t |
调出生成getter/setter/构造器等结构-generate … | alt + insert |
自动生成返回值变量-introduce variable … | ctrl + alt + v |
复制指定行的代码-duplicate line or selection | ctrl + d |
删除指定行的代码-delete line | ctrl + y |
切换到下一行代码空位-start new line | shift + enter |
切换到上一行代码空位-start new line before current | ctrl + alt + enter |
向上移动一行-move line up | alt + shift + ↑ |
向下移动一行-move line down | alt + shift + ↓ |
向上移动代码-move statement up | ctrl + shift + ↑ |
向下移动代码-move statement down | ctrl + shift + ↓ |
方法的形参列表提醒-parameter info | ctrl + p |
批量修改指定的变量名、方法名、类名等-rename | shift + f6 |
重写父类的方法-override methods … | ctrl + o |
实现接口的方法-implements methods … | ctrl + i |
选中的结构的大小写的切换-toggle case | ctrl + shift + u |
3、类结构、查找和查看源码
描述 | 快捷键 |
---|---|
显示当前类结构,支持搜索指定的方法、属性等-file structure | ctrl + f12 |
退回到前一个编辑的页面-back | ctrl + alt + ← |
进入到下一个编辑的页面-forward | ctrl + alt + → |
查看源码-go to class… | ctrl + 鼠标左键 |
打开的类文件之间切换-select previous/next tab | alt + ←/→ |
光标选中指定的类,查看继承树结构-Type Hierarchy | ctrl + h |
查看方法文档-quick documentation | ctrl + q |
类的UML关系图-show uml popup | ctrl + alt + u |
定位某行-go to line/column | ctrl + g |
回溯变量或方法的来源-go to implementation(s) | ctrl + alt + b |
折叠方法实现-collapse all | ctrl + shift + - |
展开方法实现-expand all | ctrl + shift + - |
4、查找、替换与关闭
描述 | 快捷键 |
---|---|
查找指定的结构 | ctlr + f |
快速查找:选中的Word快速定位到下一个-find next | ctrl + l |
查找与替换-replace | ctrl + r |
直接定位到当前行的首位-move caret to line start | home |
直接定位到当前行的末位 -move caret to line end | end |
关闭当前窗口-close | ctrl + f4 |
5、调整代码格式
描述 | 快捷键 |
---|---|
格式化代码-reformat code | ctrl + alt + l |
使用单行注释-comment with line comment | ctrl + / |
使用多行注释-comment with block comment | ctrl + shift + / |
选中数行,整体往后移动-tab | tab |
选中数行,整体往前移动-prev tab | shift + tab |
6、代码调试(Debug)快捷键
描述 | 快捷键 |
---|---|
查看断点 - view breakpoints | Ctrl + Shift + F8 |
单步调试(不进入函数内部)- step over | F8 |
单步调试(进入函数内部)- step into | F7 |
强制单步调试(进入函数内部) - force step into | alt + shift + f7 |
选择要进入的函数 - smart step into | shift + F7 |
跳出函数 - step out | shift + F8 |
运行到断点 - run to cursor | alt + F9 |
继续执行,进入下一个断点或执行完程序 - resume program | F9 |
停止 - stop | Ctrl + F2 |