IDEA常用快捷键
作用 | 快捷键 | 描述 |
---|---|---|
单行注释/取消单行注释 | ctrl + / | |
多行注释/取消多行注释 | ctrl + shift + / | |
格式化代码 | ctrl + shift + f | reformat code |
删除指定行的代码 | ctrl + d | delete line |
向下开始新的一行 | shift + enter | start new line |
向上开始新的一行 | ctrl + shift + enter | Start New Line before current |
向下移动行 | alt + down | move statement down |
向上移动行 | alt + up | move statement up |
向下复制指定行的代码 | ctrl + alt + down | Duplicate Lines |
选中数行,整体往后移动 | tab | |
选中数行,整体往前移动 | shift + tab | |
自动代码补全/万能解错 | alt + enter | |
查找/替换 | crtl + f | |
补全代码的声明 | alt + / | Class Name Completion |
全局搜索 | 双击shift | |
关闭当前窗口 | ctrl + w | |
关闭所有窗口 | ctrl + shift + w | |
最大化当前的View | ctrl + m | |
直接定位到当前行的首位 | home | |
直接定位到当前行的末位 | end | |
查看文档说明 | F2 | quick documentation |
快速查找,参照选中的word快速定位到下一个 | ctrl + k | |
选中的结构的大小写的切换:变成大写 | ctrl + shift + x | toggle case |
选中的结构的大小写的切换:变成小写 | ctrl + shift + y | toggle case |
快速修复 | ctrl + 1 | |
退回到前一个编辑的页面 | alt + left | back |
进入到下一个编辑的页面(针对上一个命令) | alt + right | forword |
批量导包 | ctrl + shift + o | |
查看源码 | ctrl + 选中指定的结构 或 ctrl + shift + t | class |
光标选中指定的类,查看继承树结构图 | ctrl + alt + u | |
显示构造器或者函数的所有参数列表 | ctrl + p | |
生成try/catch和if/while/runnable/synchronize等结构 | alt + shift + z | |
光标选中指定的类,查看继承层次结构 | ctrl + h | type hierarchy |
查看类中的所有方法,并支持搜索指定的方法、属性等 | ctrl + f12 获 ctrl + o | |
收起所有的方法 | alt + shift + c | collapse all |
打开所有的方法 | alt + shift + x | expand all |
查找方法在哪里被调用 | ctrl + shift + h | Call Hierarchy |
批量修改指定的变量名、方法名、类名等 | alt + shift + r | rename |
调出生成 getter/setter/tostring/构造器/测试方法等结构 | alt + shift + s | |
查看指定的结构使用过的地方 | ctrl + alt + g | |
将光标处的参数设置为全局变量 | ctrl + alt + f | |
局部变量抽取成为成员变量 | alt + shift + f | introduce field |