IDEA常用插件和配置

date
Apr 19, 2022
slug
idea
status
Published
tags
IDEA
summary
自动导包,静态分析等
type
Post

无限试用

IDEA 2021.2.2版本是最后一个可以无限试用的版本。具体可以查看知了 大佬的文章介绍,此处挂一个下载链接
  • 通常可以直接把zip包拖进IDE的窗口来进行插件的安装。如果无法拖动安装,你可以在Settings/Preferences... -> Plugins 里手动安装插件(Install Plugin From Disk...
  • 插件会提示安装成功。
 
神秘大佬的网站 https://3.jetbra.in/ 有钱还是推荐正版,正版是买断制,可以买当年的最后一个版本

安装插件

  1. Codota 代码提示,已经被tabnine收购,马上废弃,很久没更新了
  1. Alibaba 阿里巴巴出的java规范检测插件
  1. Lombok 不多介绍
  1. Translation 翻译插件
  1. SequenceDiagram UML图生成
  1. Maven helper Maven依赖分析
  1. Wechat mini program support 在webstorm中支持微信小程序
  1. tabnine 代码提示
  1. Camel Case 命名之间快速切换
  1. Key Promoter X 快捷键提示
  1. Presentation Assistant 快捷键展示
  1. Gitlab project 2020 Gitlab官方插件
  1. Save Actions 保存代码后要做的事儿
  1. Leetcode editor 刷题必备
  1. JPA Buddy jpa神器
  1. Mapstruct Support 增强对mapstruct的支持
  1. mybatiscodehelperpro mybatis的增强工具类
  1. Vue idea对vue的适配
  1. Redis idea对redis的适配
notion image
notion image

配置忽略文件

  • .iml
  • .idea
notion image

配置maven

maven配置
notion image

配置uid添加

Editor - Inspections
Search UID
notion image

自动导包

notion image

配置class签名

Editor- File and Code Templates
  • Class
  • Interface
  • Enum
  • Record
  • AnnotionType
/**
 * Copyright [2022] [remember5]
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


/**
* @author wangjiahao
* @date ${DATE} ${TIME}
*/
notion image

配置
Editor - File Encoding
Set Encoding Charset UTF-8
Checked Transparent native-to-ascii conversion
notion image
 

开源协议

notion image
notion image
 
 

MybatisPlus 生成代码

 

Jpa生成代码

 
 

远程调试代码

添加一个 remote jvm debug
notion image
 
添加name 复制 JVM的启动参数, 在服务端启动时加入参数
 
notion image
 
host 填入 远程服务器的地址
port 填入 address后面的端口号
 
参数说明:
  • transport: 监听 Socket 端口连接方式(也可以 dt_shmem 共享内存方式,但限于 Windows 机器,并且服务提供端和调试端只能位于同一台机)
  • server: =y 表示当前是调试服务端,=n 表示当前是调试客户端
  • suspend: =n 表示启动时不中断(如果启动时中断,一般用于调试启动不了的问题)
  • address: =5005 表示本地监听 5005 端口
 
注意
  • 因为这里使用到5005,所以远程服务器如果开启防火墙需要放行5005端口
    • Linux 查看防火墙状态: systemctl status firewalld
    • Linux 暂时关闭防火墙: systemctl stop firewalld
  • agentlib:xxxx必须在 -jar 之前

IDEA 协同后 git合并

idea开启协同后,多人编辑时,git会记录不同的人change,在git commit时会出现多个 changes by xxx
notion image
这个时候commit会有问题,需要提前合并下代码
notion image
notion image
选中默认的changes,点击ok
 

快捷键

 
notion image
 
try catch = win + alt + t
 
 

© WangJiaHao 2022 - 2023

豫ICP备18022029号