站内搜索

workerdance.com — Trusted craft, unfailing commitment
返回文章列表
开发工具

IDEA常用配置

本文写于 2017 年,文中涉及的软件版本可能已有变化,核心排查思路仍可参考。

注意:以下配置是按照IntelliJ IDEA ULTIMATE 2017.2.2版本,其他版本可能略有不同

1. 修改字体

-> 修改主编辑框字体:

File -> Settings -> Editor / Font

Font: Consolas

Size: 14

-> 修改菜单以及左侧框字体:

File -> Settings -> Appearance & Behavior -> Appearance

Use custom font: Microsoft Yahei Size: 13

2. 过滤文件

File -> Settings -> Editor / File Types

在右侧的Ignore files and folders中添加需要过滤的文件,以下供参考:

.hprof;.iml;.pyc;.pyo;.rbc;.yarb;*~;.DS_Store;.git;.hg;.idea;.project;.svn;CVS;pycache;_svn;vssver.scc;vssver2.scc;

3. 代码补全忽略大小写

File -> Settings -> Editor -> General / Code Completion

在右侧的Code Completion中,将Case sensitive completion改为 None

4. 修改编码

File -> Settings -> Editor -> File Encodings

修改右侧的Global Encoding和Default encoding for properties files为 UTF-8

5. Tomcat 修改jsp等页面自动部署

在Tomcat的Run/Debug Configuration中,修改 On ‘Update’ action 和 On frame deactivation为Update classes and resources

6. 安装插件

File -> Settings -> Plugins -> 选择右侧的“Browse repositories”,搜索需要的插件

(1)Free MyBatis plugin

(2)JRebel for IntelliJ(收费)

(3)CheckStyle-IDEA

7. Maven路径配置

File -> Settings -> Build, Execution, Deployment -> Build Tools -> Maven

配置Maven home directory

8. 代码跟随

勾选Autoscroll from Source

9. 逐级显示SVN改动的文件

Settings -> Version Control

-> 勾选Show directories with changed descendants

-> Confirmation -> 勾选 Highlight directories that contain modified files in the Project tree

10. 文件头部作者和日期模板

Settings -> Editor -> File and Code Templates,在右侧的Includes中的File Header中添加 @author和@Date

#set($AUTHOR="Mike Zhang")
/**
 * This class is used for
 *
 * @author ${AUTHOR}
 * @date ${DATE}
 */

注:${USER}获取系统登录用户信息

**11.**我希望每次开启工具时,由我选择开启哪个项目,而不是直接开启上次的所有的项目;我希望在新的窗口开启新的工程

12. Show memory indicator

Settings -> Appearance & Behavior -> Appearance -> 右侧勾选Show memory indicator

13. 提升编译时堆内存大小

当遇到一些比较大的项目时(譬如从github上下载的项目),导入idea,编译时,会报Caused by: java.lang.OutOfMemoryError: Java heap space错误,提升大小方法:

File -> Other Settings -> Default Settings -> Build, Execution, Deployment / Compiler -> 编辑右侧的“Build process heap size(Mbytes)”,默700M,可根据实际条件改为1024或者1500等

14. 保存文件时,去除行首行尾空白字符

Settings -> Editor -> General -> Other中,取消勾选“Always keep trailing spaces on caret line”

15. 版本控制,有改动时,层级高亮显示修改(针对style是底色白色的,如果编辑器背景色是黑色,这个配色可能不好看)

(1)File -> Settings -> Version Control,勾选“Show directories with changed descendants”

(2)File -> Settings -> Version Control -> File Status Colors,将Have changed descendants,Have immediate changed children,Modified三个设置中的color改为: B42D1A

More coming soon…

workerdance
workerdance

记录开发与运维中的实践和踩坑。