Skip to content

idea 配置

本文配置说明基于 idea 2022.3 版本

maven 配置

maven配置完后,在 idea 里面配置,如下:

idea_1.png

这样就可以使用了。

codeStyle 配置

  • line separator

调整成 Unix and MacOS

自动导包配置

idea_2.png

配置actions on save,勾选如下配置。可以实现ctrl+s自动格式化代码与去除无用 imports。

idea_3.png

live template 配置

新建一个stream group。然后分别添加如下代码:

txt
abbreviation: .groupBy
template text: .collect(Collectors.groupingBy(e -> $END$))

abbreviation: ..join
template text: .collect(Collectors.joining("$END$"))

abbreviation: .toList
template text: .collect(Collectors.toList())

abbreviation: .toSet
template text: .collect(Collectors.toSet())

注释编写

自动为创建的java类添加文件头注释

idea_4.png

热更新配置

项目编辑选择如图的方式:

idea_5.png

配置完后 debug 启动起来,

idea_6.png

如果修改了代码,idea 不会自动刷新,可以通过图中的圈圈重新载入。

必装插件

  • free mybatis plugin
  • alibaba java coding guidelines
  • maven helper
  • jump to line 调试利器,值得拥有
  • arthas idea 性能大杀器,值得拥有,方便你快捷复制 arthas 命令,便于诊断
  • apipost-helper-2.0 apifox 官方出品,便于再idea里快捷调试 web api
  • dracula主题,你值得拥有
  • git commit template check git提交辅助插件
  • Bitkylin Universal Generate swagger,javadoc 注释生成
  • ai 方面
    • chatgpt bito
    • tongyi lingma