美文网首页
idea 配置和常用快捷键

idea 配置和常用快捷键

作者: 我也有键盘 | 来源:发表于2019-01-30 18:44 被阅读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. 乱码
  • 乱码的文件中右键 -> file encoding -> UTF-8

  • 设置项目编码:file -> settings -> file encodings -> global encoding -> utf-8

  • 设置全局编码:file -> other settings -> default/settings for new project -> file encodings -> 搜索"file encodings" -> global encoding -> utf-8

  • 实在不行:到IntelliJ IDEA 2018.3.1\bin\idea64.exe.vmoptions

-Dfile.encoding=UTF-8

7. 创建多模块项目

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

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

8. 常用快捷键
  • Ctrl+Z 撤销

  • Ctrl+Shift+Z 撤销 "撤销" (冲正)

  • Ctrl + D 复制当前行并粘贴到下一行

  • Ctrl + Y 删除当前行

  • idea 不用选中也可以复制、剪切。Ctrl + C/X 自动复制/剪切 光标所在行

  • 查找:

    • Ctrl+F : 当前文件中查找
    • double Shift: 全局查找文件(类文件等文件)
    • Ctrl + Shift + F : 全局查找文本
    • Ctrl + R 当前文件检索替换
    • Ctrl + Shift + R 全局查找替换
    • Alt + F7 查找类被调用的地方 (类似eclipse中call hierarchy)
    • Ctrl + Alt + B 快速定位当前方法的实现
  • Alt + insert 生成构造方法、get/set、实现接口方法等代码

  • 块注释 : Ctrl + Shift + /

  • 格式化(format) : Ctrl + Alt + L

  • 导包优化import : Alt + Ctrl+ O

  • 重命名文件: Shift + F6

相关文章

  • 快捷键

    Windows快捷键 IDEA配置大全:链接 Mac常用快捷键 文档快捷键 Command-Z 撤销 Comman...

  • Idea 快捷键

    Idea常用快捷键 Idea快捷键(全)

  • IntelliJ IDEA

    IntelliJ IDEA详细配置和使用教程 java工具IDEA--关于IDEA中的快捷键(收集) 这样配置:让...

  • IDEA使用篇3-常用配置

    一.IDEA常用配置 进入设置界面image.png 查看配置项image.png 查看快捷键image.png ...

  • idea常用快捷键

    idea常用快捷键

  • IDEA常用快捷键

    IDEA常用快捷键

  • IDEA 常用快捷键小结

    IDEA 常用快捷键小结 最最常用的 IDEA 快捷键 快捷键功能ALT+Enter导入包、自动修正CTRL+AL...

  • idea 配置和常用快捷键

    idea配置 1. 设置SDK及SDK编译版本、字体、编码 file -> Project Structure -...

  • intellij 快捷键

    IDEA idea快捷键 Intellij IDEA最常用快捷键 1.Ctrl+E,可以显示最近编辑的文件列表 2...

  • idea的使用收录

    IDEA(jetbrain通用)优雅级使用教程IntelliJ Idea 常用快捷键列表

网友评论

      本文标题:idea 配置和常用快捷键

      本文链接:https://www.haomeiwen.com/subject/mnicsqtx.html