@toc
功能快捷键
执行
(run) alt + r提示补全
(Class Name Completion) alt + /单行注释
ctrl + /多行注释
ctrl + shift + /向下复制一行
(Duplicate Lines) ctrl + alt + down删除一行或选中行
(delete line) ctrl + d向下移动行
(move statement down) alt + down向上移动行
(move statement up) alt + up向下开始新的一行
(start new line) shift + enter向上开始新的一行
(Start New Line before current) ctrl + shift + enter如何查看源码
(class) ctrl +选中指定的结构
或 ctrl + shift + t万能解错/生成返回值变量
alt + enter退回到前一个编辑的页面
(back) alt + left进入到下一个编辑的页面
(针对于上条) (forward) alt + right查看继承关系
(type hierarchy) F4格式化代码
(reformat code) ctrl + shift + F提示方法参数类型
(Parameter Info) ctrl + alt + /复制代码
ctrl + c撤销
ctrl + z反撤销
ctrl + y剪切
ctrl + x粘贴
ctrl + v保存
ctrl + s全选
ctrl + a选中数行,整体往后移动
tab选中数行,整体往前移动
shift + tab查看类的结构
:类似于 eclipse 的 outline ctrl + o重构:修改变量名与方法名
(rename) alt + shift + r大写转小写/小写转大写
(toggle case) ctrl + shift + y生成构造器
/get/set/toString alt + shift + s查看文档说明
(quick documentation) F2收起所有的方法
(collapse all) alt + shift + c打开所有方法
(expand all) alt + shift + x打开代码所在硬盘文件夹
(show in explorer) ctrl + shift + x生成 try-catch 等
(surround with) alt + shift + z局部变量抽取为成员变量
(introduce field) alt + shift + f查找/替换(当前)
ctrl + f查找(全局)
ctrl + h查找文件
double
Shift查看类的继承结构图
(Show UML Diagram) ctrl + shift + u查看方法的多层重写结构
(method hierarchy) ctrl + alt + h添加到收藏
(add to favorites) ctrl + alt + f抽取方法
(Extract Method) alt + shift + m打开最近修改的文件
(Recently Files) ctrl + E关闭当前打开的代码栏
(close) ctrl + w关闭打开的所有代码栏
(close all) ctrl + shift + w快速搜索类中的错误
(next highlighted error) ctrl + shift + q选择要粘贴的内容
(Show in Explorer) ctrl + shift + v查找方法在哪里被调用
(Call Hierarchy) ctrl + shift + h
代码快捷键
psvm
: 可生成 main 方法sout
: System.out.println() 快捷输出
类似的:
soutp
=> System.out.println("方法形参名 = " + 形参名);soutv
=> System.out.println("变量名 = " + 变量);soutm
=> System.out.println("当前类名.当前方法"); "abc".sout => System.out.println("abc");
- fori : 可生成 for 循环
类似的:
iter
:可生成增强 for 循环itar
:可生成普通 for 循环
list.for
: 可生成集合 list 的 for 循环
例如:List list = new ArrayList(); 输入: list.for 即可输出 for(String s:list){ } 又如:list.fori 或 list.forr
ifn
:可生成 if(xxx = null):inn
:可生成 if(xxx != null) 或 xxx.nn 或 xxx.nullprsf
:可生成 private static finalpsf
:可生成 public static finalpsfi
:可生成 public static final intpsfs
:可生成 public static final String