IDEA快捷键及模板


本人是使用IDEA 2018.3.x,都是手工验证过的:

快捷键

1 执行(run) alt+F10
2 提示补全 ctrl+alt+空格 (Class Name Completion)
3 单行 注释 ctrl + /
4 多行注释 ctrl + shift + /
5 向下复制一行 ctrl+D (Duplicate Lines)
6 删除一行或选中行 ctrl+Y (delete line)
7 向下移动行 ctrl+shift+向下箭头 (move statement down)
8 向上移动行 ctrl+shift+向上箭头(move statement up)
9 向下开始新的一行 shift+enter (start new line)
10 向上开始新的一行 ctrl+alt+enter
11 如何查看源码 ctrl + 选中指定的结构 或
双击 shift 然后输入想要查找的源码
12 万能解错/ 生成返回值变量 alt + enter
13 退回到前一个编辑的页面 ctrl+alt + 左箭头 (back)
14 进入到下一个编辑的页面 ctrl+alt + 右箭头( 针对于上条)
15 查看继承关系Ctrl + H (type hierarchy)
查看继承关系图:Ctrl + Alt + U
16 格式化代码 Ctrl+Alt+L (reformat code)
17 提示方法参数类型 Ctrl+P (Parameter Info)
18 复制代码 ctrl + c
19 撤销 ctrl + z
20 反撤销 ctrl + y
21 剪切 ctrl + x
22 粘贴 ctrl + v
23 保存 ctrl + s
24 全选 ctrl + a
25 选中数行,整体往后移动 tab
26 选中数行,整体往前移动 shift + tab
27 查看类的结构:类似于eclipse的outline ctrl+F12
28 重构 : 整体修改变量名与方法名 shift+F6 (rename)
29 大写转小写/ 小写转大写 ctrl+shift+U (toggle case)
30 生成构造器/get/set/toString alt + Insert
31 查看文档说明(quick documentation) Ctrl + Q
32 收起所有的方法(collapse all) Ctrl + shift + 减号
33 打开所有方法(expand all) Ctrl + shift + 加号
34 打开代码所在硬盘文件夹(show in explorer)
可以自己设置一个 (我设置的是Ctrl+Shift+逗号)
35 生成 try-catch等 Ctrl+Alt+T (surround with)
36 局部变量抽取为成员变量(introduce field)
Ctrl+Alt+F
37 查找/ 替换( 当前) ctrl+f
38 查找( 全局) ctrl+shift+f
39 查找方法在哪里被调用(Call Hierarchy) ctrl+alt+h
40 查看类的继承结构图(Show UML Diagram) ctrl + Alt + U
41 查看方法的多层重写结构(method hierarchy) ctrl+shift+h
42 添加到收藏(add to favorites) alt+shift + f
43 抽取方法(Extract Method) alt+ctrl+m
44 快速搜索类中的错误(next highlighted error) F2

自带模板

  1. psvm
public static void main(String[]args){

        }
  1. sout
sout:
System.out.println();

soup :
System.out.println("args = [" + args + "]"); //输出形参

souv:
	int a = 1 ;
	System.out.println("a = " + a);  //输出变量值

xxx.out;
System.out.println(xxx);
  1. fori
for (int i = 0; i < ; i++) {
            
        }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章