Fork me on GitHub

提升Intellij IDEA工具生产力

目录

  • 背景
  • 第一部分 常用快捷键
  • 参考文献及资料

背景

记录常用的ideal快捷输入;

第一部分 常用快捷键

1.1 mian主函数快捷键

psvm

1
2
3
public static void main(String[] args) {

}

1.2 输出快捷键

sout

1
System.out.println();

1.3 循环遍历快捷键

iter

1
2
3
for (String arg : args) {

}

1.4 生成公共静态final

psf

1
public static final

1.5 生成公共静态 final int

psfi

1
public static final int

1.6 生成公共静态final String

psfs

1
public static final String

第二部分 自动配置注释

创建文件时,idea自动生成注释

过程是,在设置中找到“File and Code Templates”,在类文件的模板中添加注释。具体如下图(图1)所示:

(1)首先打开设置,点File,Settings即可打开下图界面,或者直接用快捷键Ctrl+Alt+S打开设计界面。

(2)在搜索框中输入“File and Code Templates”,打开“File and Code Templates”。

(3)在右侧的Files一栏中,找到Class,编辑注释。下面的Description介绍了可以使用的系统变量,按需索取。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")

/**
* @program: ${PROJECT_NAME}
*
* @description: ${description}
*
* @author: rongxiang
*
* @create: ${YEAR}-${MONTH}-${DAY} ${HOUR}:${MINUTE}
**/

public class ${NAME} {
}

参考文献及资料

1、IntelliJ IDEA,链接:https://www.jetbrains.com/idea/

0%