Skip to content

IDEA的一些设置

1.自动导包

image-20211130154149777

2.忽略大小写提示

image-20211130154232729

3.取消单行tabs显示

image-20211130154302924

4.项目文件编码

image-20211130154459084

5.类注释

image-20210629103944356

java
/**
  * @Author: xueqimiao
  * @Date: ${DATE} ${TIME}
  */

/**
  *
  * @ProjectName: ${PROJECT_NAME}
  * @ClassName: ${NAME}
  * @Description: TODO(一句话描述该类的功能)
  * @Author: ${USER}
  * @Date: ${DATE} ${TIME}
  * @version v1.0
  */

${PACKAGE_NAME}
name of the package in which the new file is created
${USER}
current user system login name
${DATE}
current system date
${TIME}
current system time
${YEAR}
current year
${MONTH}
current month
${MONTH_NAME_SHORT}
first 3 letters of the current month name. Example: Jan, Feb, etc.
${MONTH_NAME_FULL}
full name of the current month. Example: January, February, etc.
${DAY}
current day of the month
${DAY_NAME_SHORT}
first 3 letters of the current day name. Example: Mon, Tue, etc.
${DAY_NAME_FULL}
full name of the current day. Example: Monday, Tuesday, etc.
${HOUR}
current hour
${MINUTE}
current minute
${PROJECT_NAME}
the name of the current project

6.方法注释

clipboard(1)

clipboard(1)

java
/**
  * @Author: xueqimiao
  * @Title: $enclosing_method$
  * @Description: 
  * @param @param $tags$
  * @return @return $return_type$
  * @throws
  * @Date: ${DATE} ${TIME}
  */

/**
 * @Title: $enclosing_method$
 * @Description: TODO(这里用一句话描述这个方法的作用)
 * @param @param $tags$
 * @return @return $return_type$
 * @author $user$
 * @throws
 * @date $date$ $time$
 */

7.设置不自动折叠

image-20211130154611284

8.解决tomcat控制台乱码问题

image-20210629104744205

image-20210629104756704

sh
-Dfile.encoding=UTF-8

image-20210629104916624

image-20210629104950271

9.@Autowired注解报错和下方有波浪线

image-20210713172301575

10.去除波浪线

1、代码中的波浪线

File -- Setting -- Editor -- Inspections,右侧搜索General,取消√,保存退出

image-20210629105439712

11、IDEA自动生成序列化ID

File -> Settings -> Editor -> Inspections -> 搜索 Serialization issues ,找到 Serializable class without 'serialVersionUID' ->打上勾,Apply->OK

image-20211118174251481

image-20220123184045822

12、开启Run DashBoard

自己的项目路径下的.idea文件夹下的workspace.xml F:\1\xxx.idea RunDashboard标签(自己加)下加上以下内容后重启IDEA

xml
<option name="configurationTypes">
      <set>
        <option value="SpringBootApplicationConfigurationType" />
      </set>
</option>
  • 下面这种也行
xml
<component name="RunDashboard">
    <option name="ruleStates">
        <list>
            <RuleState>
                <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
            </RuleState>
            <RuleState>
                <option name="name" value="StatusDashboardGroupingRule" />
            </RuleState>
        </list>
    </option>
</component>

13、双斜杠注释改成紧跟代码头

图片

14、Codota 代码智能提示插件

图片

只要打出首字母就能联想出一整条语句,这也太智能了,还显示了每条语句使用频率。

原因是它学习了我的项目代码,总结出了我的代码偏好。

15、Key Promoter X 快捷键提示插件

image-20220323092057724

每次都会在右下角弹窗提示,帮助我们快速熟悉快捷键。

16、CodeGlance 显示代码缩略图插件

图片

当代码很多的时候,方便查看,很有用。

17、CamelCase 驼峰命名和下划线命名转换

图片

这几种风格的命名方式,用快捷键 ⇧ + ⌥ + U / Shift + Alt + U可以进行快速转换,当我们需要修改大量变量名称的时候很方便。

18、SonarLint 代码质量检查插件

图片

提示我不要用System.out输出,要用logger输出,诸如此类,帮助我们提升代码质量。

19、Translation 翻译插件

图片

20、Rainbow Brackets 彩虹括号插件

图片

21、2021新版idea过滤无用文件

image-20220418145852745

点击加号,添加需要过滤的后缀,如:*.iml。 回车apply即可生效

最后更新于: