IDEA 配置优化 提高开发效率

转自:http://blog.csdn.net/hw1287789687/article/details/51058346

去掉烦人的indent提示

ident 提示 
如何去掉呢? 
打开IDEA 的preferences|Editor|Code Style, 
去掉下图中的两个勾选: 
去掉勾选

设置文件的模板

我们创建一个java文件时,会在类的上面自动添加注释,包括作者和日期. 
其实我们可以定制这个自动添加的注释: 
修改模板

原来是这样的: 
这里写图片描述 
修改为: 
这里写图片描述

定制自己的snippet

snippet就是代码片段 
用过eclipse的同学都知道,我们输入Sysout就会自动转换为:

System.out.println();
  • 1

演示eclipse 
其实IDEA 也有相同的功能: 
自定义snippet

添加自定义文件类型

IDEA中没有jsp,所以我手动添加JSP: 
添加自定义类型的文件
下面附上JSP的模板:

<%@ 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变量

JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
  • 1

注意:下面的四个,每个都得手动设置一次: 
这里写图片描述 
解决之后: 
中文不再乱码
参考:idea 控制台输出 中文乱码 解决方法

隐藏IDEA cast unchecked警告

这里写图片描述

未保存的文件标识出

这里写图片描述
参考:Intellij IDEA自动编译不用每次make


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值