idea 配置和常用快捷键

2019-01-30  本文已影响0人  我也有键盘

idea配置

1. 设置SDK及SDK编译版本、字体、编码

file -> Project Structure -> ProjectSdk

file -> settings -> 搜索font、encoding,分别设置字体、编码

搜索功能真好用...

  • 类似的,设置注释模板时,搜索"template" 就能找到相应界面设置
2. 配置maven

file -> settings 搜索框搜索maven ,将maven的Maven home directory设置成自己的;

default settings: idea全局配置(或 新点的版本没有default settings 变成settings for new project) 全局配置;
settings:当前项目配置

3. 设置代码编译java版本

file -> other setting -> settings for new project 搜索Java compl,将project bytecode version 设置为8,全局配置编译版本为1.8

file -> project structure -> 将本次打开的项目编译版本设置为1.8

修改pom,添加插件指定maven 编译版本:

官方文档:http://maven.apache.org/components/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-complier-plugin</artifactId>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <encoding>UTF-8</encoding>
    </configuration>
</plugin>
4. 配置git

file -> settings -> 搜索git -> 设置git.exe目录

5. 修改配置文件、缓存文件的位置

idea对项目文件做了索引,以加快查找速度。创建索引、加载缓存等都需要消耗时间。

索引、缓存文件默认保存在C盘 userhome下

idea.system.path=${user.home}/.IntelliJIdea/system

随着使用idea频率的增高,system文件会变大。如果C盘空间不足,可以修改到其他盘

IntelliJ IDEA 2018.3.1\bin\idea.properties

  • idea.system.path
  • idea.config.path

补充一点,idea64.exe.vmoptions/idea32.exe/vmoptions分别是64/32位idea的配置文件。在这里配置的是虚拟机参数等。例如,加用户名

-Duser.name=xxx

6. 乱码

-Dfile.encoding=UTF-8

7. 创建多模块项目

右键父项目-> New Module -> quickstart -> 填入ArtifactId

每个模块都是一个独立的maven工程,拥有自己的pom

8. 常用快捷键
上一篇 下一篇

猜你喜欢

热点阅读