IDEA使用总结

IDEA使用总结

下载:https://www.jetbrains.com/idea/

常用配置

1. 启动文件优化

bin\idea.exe.vmoptions和 bin\idea64.exe.vmoptions

-server
-Xms256m
-Xmx1024m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Dfile.encoding=UTF-8
2. 修改配置文件位置 在安装目录新建config文件夹,修改/bin目录下的idea.properties
idea.config.path=D:/ideaIU2018/config/.IntelliJIdea/config

idea.system.path=D:/ideaIU2018/config/.IntelliJIdea/system

idea.plugins.path=${idea.config.path}/plugins

idea.log.path=${idea.system.path}/log
3. 修改快捷键 keymap
Complete Code Basic->alt+/
rename->F2
4. 修改编码

FILE ENCODINGS

DEFAULT ENCODING FOR PROPERTIES FILES->UTF-8

*compile->java compile *

ADDITIONAL COMMAND LINE PARAMETERS
加上参数 -ENCODING UTF-8

file types->ignore files

*.hprof;*.pyc;*.pyo;*.rbc;*.yarb;*~;.DS_Store;.git;.hg;.svn;CVS;__pycache__;_svn;vssver.scc;vssver2.scc; // old

CVS;SCCS;RCS;rcs;.DS_Store;.svn;.pyc;.pyo;*.pyc;*.pyo;.git;*.hprof;_svn;.sbas;.IJI.*;vssver.scc;vssver2.scc;.*;*.iml;*.ipr;*.iws;*.ids;*.rbc;*.yarb;*~;.hg;__pycache__; // new

修改文件的默认打开方式

Recognized Type // 选择打开方式 比如Text
Registered Patterns // 添加文件类型 比如Dockerfile
5. 设置类头注释

File And Code Templates

/**
 * TODO
 * 
 * @author crazypenguin
 * @version 1.0.0
 * @createdate ${DATE}
 */

Live Template

新建MyGroup
选中MyGroup,新建LiveTemplate
ByDefault expand with->tab
Abbreviation->/**  // 输入指令+tab
Description->class anno  // 描述 
Edit variables->DATE:date() // 对应下面的$DATE$
Application in...->Everywhere  

/**
 * TODO
 * 
 * @author crazypenguin
 * @version 1.0.0
 * @createdate $DATE$
 */
  • 可使用的参数
参数说明
${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
${HOUR}current hour
${MINUTE}current minute
${PROJECT_NAME}the name of the current project
6. Maven设置
Maven home directory   //选择本地Maven根目录
Use setting file   // 选择根目录/conf下的settings.xml
Local repository   // 本地仓库
override 全部勾选
7. 去掉mybatis背景色
  • Databse->DataSource->Mysql

  • Editor->Inspections

SQL dialect detection 去掉勾选
  • Editor->Color Scheme->General
Injected language fragment 去掉勾选
8. 其他
  • 修改字体

Editor->Font

Source Code Pro 12号
  • 去掉重复代码的波浪线

Editor->Inspections

General->Duplicated Code 去掉勾选
  • 去掉未使用代码的波浪线

Editor->Color Scheme->General

Unused symbol 去掉勾选 
  • 修改配置文件properties配色

Editor->Color Scheme->Properties

  • Run Dashboar看不到 .idea/workspace.xml
<component name="RunDashboard"> // 节点加入
    <option name="configurationTypes">
      <set>
        <option value="SpringBootApplicationConfigurationType" />
      </set>
    </option>
  • 去掉@Autowired注解失败的情况
Autowiring for bean class->Error改成Warning
  • 去掉注释里面提示的错误
has problems in javadoc references->warning
  • maven不下载了
mvn -U idea:idea
  • spring-boot-devtools在Idea中热部署方法
<!--添加依赖-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <!-- optional=true,依赖不会传递,该项目依赖devtools;之后依赖myboot项目的项目如果想要使用devtools,需要重新引入 -->
    <optional>true</optional>
</dependency>

更改idea配置
  1) “File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically” 。

  2) 组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running” 。
  
Chrome禁用缓存

  F12或者“Ctrl+Shift+I”,打开开发者工具,“Network” 选项卡下 选中打勾 “Disable Cache(while DevTools is open)” 

Plugins

  • Lombok
  • Alibaba Java Code GuideLines
  • MyBatisX
  • Free MyBatis Plugin
  • GsonFormat
  • FindBugs-IDEA
  • stackoverflow
  • Markdown support
  • CodeGlance
  • Background Image Plus
  • BashSupport
  • actiBPM
  • .ignore
  • p3c
  • Maven Helper
  • VisualVM Launcher
  • GenerateAllSetter
  • MyBatisCodeHelperPro
  • Translation
  • Statistics
  • vue.js

Git设置

Path to Git executable   // Git\cmd\git.exe

svn设置

  1. 安装TortoiseSVN
  2. 勾选command line client tools image

Debug

快捷键说明
Ctrl+F2停止
Alt+Shift+F9选择 Debug
Alt+Shift+F10选择 Run
Ctrl+Shift+F9编译
Ctrl+Shift+F10运行
Ctrl+Shift+F8查看断点
F8step over,进入下一步,如果当前行断点是一个方法,则不进入当前方法体内
F7step into,进入下一步,如果当前行是一个方法,则进入方法体内(自定义方法)
Shift+F7强制进入方法体(官方类库底层源码)
Shift+F8step out,退出
Alt+Shift+F8强制退出
Alt+Shift+F7强制进入
Alt+F9运行至光标处
Ctrl+Alt+F9强制运行至光标处
F9恢复程序
Alt+F10定位到断点
Ctrl+F8切换行断点
Ctrl+F9生成项目
Alt+1项目
Alt+2收藏
Alt+6TODO
Alt+7结构
Ctrl+Shift+C复制路径
Ctrl+Alt+Shift+C复制引用,必须选择类名
Ctrl+Alt+Y同步
Ctrl+~快速切换方案(界面外观、代码风格、快捷键映射等菜单)
Shift+F12还原默认布局
Ctrl+Shift+F12隐藏/恢复所有窗口
Ctrl+F4关闭
Ctrl+Shift+F4关闭活动选项卡
Ctrl+Tab转到下一个拆分器
Ctrl+Shift+Tab转到上一个拆分器

转载于:https://my.oschina.net/crazydpenguin/blog/3011472

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值