您的位置:首页 > 编程语言 > Java开发

IDEA 配置优化 提高开发效率

2016-04-04 20:35 573 查看

IDEA 配置优化,提高开发效率

去掉烦人的indent提示



如何去掉呢?

打开IDEA 的preferences|Editor|Code Style,

去掉下图中的两个勾选:



设置文件的模板

我们创建一个java文件时,会在类的上面自动添加注释,包括作者和日期.

其实我们可以定制这个自动添加的注释:



原来是这样的:



修改为:



定制自己的snippet

snippet就是代码片段

用过eclipse的同学都知道,我们输入Sysout就会自动转换为:

System.out.println();




其实IDEA 也有相同的功能:



添加自定义文件类型

IDEA中没有jsp,所以我手动添加JSP:



下面附上JSP的模板:

#[[$Title$]]#

#[[$END$]]#

" data-snippet-id="ext.0a9d8760ee37731433e5d49c6c9f0d59" data-snippet-saved="false" data-codota-status="done">[code]<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
if (path.equals("/")) {
path = "";
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<%=path%>/static/css/global.css">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1">
<script type="text/javascript" src="http://hbjltv.com/static/js/jquery-1.11.1.js"></script>

<title>#[[$Title$]]#</title>
</head>
<body>
#[[$END$]]#
</body>
</html>


去掉框架检查提示



如何去掉框架的检查提示呢?



Code completion case sensitivity

By default IntelliJ IDEA code completion case sensitivity only affects the first letter you type. This strategy can be changed in the Settings/Preferences dialog, Editor | General | Code Completion, so you can make to either make the IDE sensitive to all letters or make it insensitive to the case at all, based on what better fits your preferences.

改为不区分大小写:



解决mac IDEA控制台中文乱码



解决方法:





JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8


注意:下面的四个,每个都得手动设置一次:



解决之后:



参考:idea 控制台输出 中文乱码 解决方法

隐藏IDEA cast unchecked警告



未保存的文件标识出



参考:Intellij IDEA自动编译不用每次make
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  idea java snippet