推荐 | 作为IDEA的死忠粉,这样设置,效果棒棒哒!

147 阅读2分钟

第一个

IDEA的代码提示有一个补充的特点,区分大小写,这个功能如图1所示。默认就是区分大小写的。举个栗子,在Java代码中输入stringBuffer,是不会默认提示,而输入StringBuffer可以进行代码提示。

![](https://upload-images.jianshu.io/upload_images/20887676-48a5aeaafb55e40f?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

第二个

一和二两个选项,是用来优化 import 包的导入和导出功能的 当勾选 1 选项的时候,IDEA 可以在我们书写代码的时候,自动帮助导入的包,例如去掉没有用到的包。当勾选 2 的时候,IDEA 可以书写代码的时候,自动导入用的包。相当的智能化。

![](https://upload-images.jianshu.io/upload_images/20887676-004ea6eb3b0c6c33?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

第三个

例如上图画红圈的地方所示,可以进行指定的默认折叠或者展开,例如勾选上HTML的style标签选项,在打开文件的时候,该标签所包含的内容,会自动折叠,否则不会自动折叠。

![](https://upload-images.jianshu.io/upload_images/20887676-6e2a14d56393f8b5?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

第四个

如上图所示,IDEA支持对代码进行垂直或者是水平分组,一般在对文件进行修改的时候,一个是修改的文件,一个是参考文件,这样效率更快一点

![](https://upload-images.jianshu.io/upload_images/20887676-c535b17fb0932eb0?imageMogr2/auto-orient/strip)

快捷键

垂直分屏快捷键关键字:

Split Vertically

水平分屏快捷键关键字:

Split Horizontally

第五个

使用 Ctrl + D 会自动复制整行内容,然后自动复制到下一行。

![](https://upload-images.jianshu.io/upload_images/20887676-97a324189de64c8b?imageMogr2/auto-orient/strip)

第六个

如上图所示,设置好以后,IDEA会默认显示内存的占用情况。

![](https://upload-images.jianshu.io/upload_images/20887676-da52b12f9fc8aede?imageMogr2/auto-orient/strip)

第七个

勾选此设置以后,使用 ctrl + 鼠标滚轮 可以快捷的控制代码的字体。

![](https://upload-images.jianshu.io/upload_images/20887676-6ee3b13545a87078?imageMogr2/auto-orient/strip)

第八个

如上图所示,勾选上 show line numbers 选项以后,会显示方法线,这种线条有助于区分开方法。

![](https://upload-images.jianshu.io/upload_images/20887676-7d98911b6ac2e751?imageMogr2/auto-orient/strip)

第九个

![](https://upload-images.jianshu.io/upload_images/20887676-5b162e680875ef74?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

使用此Tab,文件名可以多放显示。

第十个

![](https://upload-images.jianshu.io/upload_images/20887676-eb4563cd1cbcfcc3?imageMogr2/auto-orient/strip)

这样设置以后,注释在代码的头部

第十一个

这样设置好以后,代码可以实现软分行

![](https://upload-images.jianshu.io/upload_images/20887676-6c902fefbc7cc820?imageMogr2/auto-orient/strip)

第十二个

如上图所示,如果在make或rebuild过程中相当的慢,可以尝试增加堆内存,这样可以加快速度。

![](https://upload-images.jianshu.io/upload_images/20887676-0097d1a8f9c6ead3?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

第十三个

勾选上以后,启动IDEA的时候,会默认打开上次使用的项目,如果有多个项目,会打开多个项目。如果关闭此选项,可以直接打开主界面。

![](https://upload-images.jianshu.io/upload_images/20887676-9d8968e177dfa09a?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

第十四个

此设置会增加打开tab的个数,如果超过这个个数,早打开的文件会被替换。

![](https://upload-images.jianshu.io/upload_images/20887676-8a874447343e91d4?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

第十五个

![](https://upload-images.jianshu.io/upload_images/20887676-362d1d4453a82daa?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

默认的IDEA是没有开启自动帮你生成serialVersionUID功能的,需要我们设置。第一张,设置自动生成serialVersionUID 第二张,它已经继承了serializable接口的类名,把光标放在类名上,按住alt + Enter,即可自动生成 serialVersionUID功能。

![](https://upload-images.jianshu.io/upload_images/20887676-387cfff1a142e5ba?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

如上图,可以设置默认测试浏览器。

![](https://upload-images.jianshu.io/upload_images/20887676-d3a81534a0637748?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)