IDEA 个人日常设置

设置花括号对齐方式

IDEA 默认花括号跟方法名在同一行,如果想花括号另起一行对齐,可以这样做:

1
2
File -> Setting -> Editor -> Code Style -> Java
在右边界面找到 **Wrapping and Braces**

取消 mybatis 的 xml 文件 sql 语句黄色高亮

Editor -> Inspections -> SQL -> SQL dialect detection 取消打勾

如果还对剩下的暗绿色高亮背景不顺眼,还可以在 Editor -> Color Scheme -> General 把 Code 选项的 Injected language fragment 选项的 Background 取消。

取消只有一行的方法体自动折叠

File->Setting->Editor->General->Code Folding,把 one-line methods 打勾取消

Intellij IDEA 自动生成 serialVersionUID

Setting -> Inspections -> Serialization issues -> Serializable class without ’serialVersionUID’