File -> New Projects Setup -> Structure...
Perferences -> Build,Execution,Deployment -> Build Tools -> Maven
Perferences -> Editor -> General -> Auto Import
Perferences -> Editor -> File and Code Templates
class 注释模板示例
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
/**
* @author: ${USER}
* @date: ${DATE} ${TIME}
* @description:
*/
public class ${NAME} {
}
Perferences -> Editor -> General -> Appearance
Perferences -> Editor -> General -> Code Completion
Perferences -> Editor -> Code Style
阿里巴巴的 Java 开发规范推荐每行长度不要超过 120,但是我习惯用 200
Perferences -> Editor -> Color Scheme -> Java
去掉Inherit values from 前面的√,选中 Foreground 自己设置个喜欢的颜色
这是我现在的配置 Line comment: FFB704, Text: 02FA15
Perperences -> Appearance & Behavior -> System Settings
Perferences -> Editor -> Font
我习惯使用 Consolas 字体,但是 mac 上默认没有这个字体,需要自行安装: http://www.fontpalace.com/font-details/Consolas/
Perferences -> Editor -> File Encodings
直接使用 UTF-8 编码即可,如果出现乱码,记得勾选下面的 Transparent native-to-ascii conversion
IDEA 默认的堆配置貌似是 750MB,启动一个大型项目时,这点内存不大够用,可以自己通过如下配置修改
help -> Edit custom VM options
修改配置 -Xmx8192m, 按照自己电脑内存大小配置
Perferences -> Editor -> General -> Editor Tabs
Perferences -> Editor -> General -> Editor Tabs
Perferences -> Editor -> Inspections
在实现了 Serializable 接口的类上使用快捷键 alt+enter,就会提示生成 SerialVersionUID
![]()
很实用。不过文章里面的 Edit 应该指的是 Editor 吧?
将小标题改为 h2 可以在文章旁边显示目录,目录是显示 h2 和 h3。