当前位置: 首页 > news >正文

idea总结

一、关闭注释折叠

1.1、现象

1.2、解决方法

File ==> Settings ==> General ==> Apperance ==> 取消勾选Render documention comments;

1.3、效果

1.4、参考

https://blog.csdn.net/ibigboy/article/details/129258800

二、忽略提交部分文件

.idea
.mvn
.mvnw
mvnw
mvnw.cmd
*.iml
HELP.md

三、新建Java文件时,自动生成作者信息

File ==> Settings ==> Editor ==>File and Code Templates ==> Includes ==> File Header

/*** @Author : 一叶浮萍归大海* @Date: ${DATE} ${TIME}* @Description: */    

四、新版Idea(2022)的Git不显示local代码

4.1、现象

4.2、解决方法

File==》Settings==》Version Control==》Commit==》取消勾选第一项

五、全局配置

5.1、全局maven配置

IDEA启动页面 ==> Customize ==> All settings ==> Build,Execution,Deployment ==> Build Tools ==>Maven

5.2、全局编码配置

IDEA启动页面 ==> Customize ==> All settings ==>Editor ==> File Encodings

5.3、全局注解生效激活

IDEA启动页面 ==> Customize ==> All settings ==> Build,Execution,Deployment ==> Compiler ==> Annotation Processors ==> Enable annotation processing

5.4、全局激活DevTools配置

IDEA启动页面 ==> Customize ==> All settings ==> Build,Execution,Deployment ==> Compiler

5.5、全局Java编译版本配置

IDEA启动页面 ==> Customize ==> All settings ==> Build,Execution,Deployment ==> Compiler ==> Java Compiler

5.6、全局File Types过滤

六、Live Templates

6.1、fast

fast 快速在类上添加注解@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)

6.2、getThreadName

getThreadName快速获取当前线程的名字Thread.currentThread().getName()

6.3、info

info快速打印log日志log.info(" result:{}", result);

6.4、infoj

infoj快速打印json日志log.info(" result:{}", JSON.toJSONString(result));

6.5、infopj

infopj快速打印Controller层的参数log.info(" param:{}", JSON.toJSONString(param));

6.6、mainb

mainb快速生成springboot主启动类的main方法public static void main(String[] args) {SpringApplication.run(.class, args);
}

6.7、msb

msb在Springboot的主启动类上快速添加注解@MapperScan(basePackages = "org.star.mapper")
@SpringBootApplication

6.8、sdf

sdf快速生成格式化日期SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

6.9、sst

sst在Springboot的测试类上快速添加注解@Slf4j
@SpringBootTest

6.10、tryc

tryc快速生成try...catch代码块try {} catch (Exception e) {}


6.11、trycf

trycf快速生成try...catch...finally代码块try {} catch (Exception e) {} finally {}

6.12、tryf

trycf快速生成try...catch...finally代码块try {} catch (Exception e) {} finally {}

6.13、threadfor40

threadfor10快速生成10个线程for (int i = 1; i <= 10; i++) {new Thread(() -> {}, String.valueOf(i)).start();
}

6.14、threadNew

threadNew快速创建一个线程new Thread(() -> {try {} catch (Exception e) {e.printStackTrace();}
}, "线程名字").start();

6.15、threadSleepTimeUnit

threadSleepTimeUnit线程快速休眠(单位:秒)// 线程休眠(单位:秒)
try { TimeUnit.SECONDS.sleep(4); } catch (Exception e) {e.printStackTrace();}

6.16、noArgs

noArgs快速打印无参构造方法被调用了System.out.println("xxx's NoArgsConstructor was invoked!");

6.17、allArgs

allArgs快速打印有参构造方法被调用了System.out.println("xxx's AllArgsConstructor was invoked!");

6.18、initJVMParams

initJVMParams快速打印jvm的配置信息-Xms10m -Xmx10m -XX:+PrintGCDetails

6.19、lock.lock

lock.lock快速生成JUC lock代码块lock.lock();
try {// do your business...
} catch (Exception e) {e.printStackTrace();
} finally {lock.unlock();
}

6.20、threadFor40Group

threadFor40Group快速生成一组同名的线程new Thread(() -> {for (int i = 1; i <= 40; i++) {}
},"线程名字").start();

http://www.lryc.cn/news/601178.html

相关文章:

  • JVM工具
  • 【优选算法】BFS解决FloodFill算法
  • Element表格单元格类名动态设置
  • VILA系列论文解读
  • 基于mnn架构在本地 c++运行llm与mllm模型
  • PostgreSQL AND OR 操作符详解
  • esp32s3创建rust工程 window成功mac
  • 前后端分离:架构模式与实践
  • Qt 分裂布局:QSplitter 使用指南
  • 四、搭建springCloudAlibaba2021.1版本分布式微服务-加入openFeign远程调用和sentinel流量控制
  • UNet 改进(38):融合多尺度输入与可变形卷积、门控特征融合的医学图像Unet分割网络
  • MySQL 事务和锁
  • 02人工智能中优雅草商业实战项目视频字幕翻译以及声音转译之以三方AI模型API制作方式预算-卓伊凡|莉莉
  • 车载诊断架构 ---面向售后的DTC应该怎么样填写?
  • KNN算法实战:手写数字识别详解
  • 前端基础班学习路线
  • Git+宝塔面板部署Hugo博客
  • net8.0一键创建辅助开发的个人小工具
  • 剑指offer第2版:双指针+排序+分治+滑动窗口
  • 零基础学习性能测试第五章:JVM性能分析与调优-GC垃圾分代回收机制与优化
  • 【嵌入式硬件实例】-555定时器调光电路实现
  • 工业控制系统安全之 Modbus 协议中间人攻击(MITM)分析与防范
  • DAY21-二叉树的遍历方式
  • 数据结构 堆(4)---TOP-K问题
  • Canvas实现微信小程序图片裁剪组件全攻略
  • mmap的调用层级与内核态陷入全过程
  • 六、搭建springCloudAlibaba2021.1版本分布式微服务-admin监控中心
  • 记录一次薛定谔bug
  • 基于LNMP架构的分布式个人博客搭建
  • Java大数据面试实战:Hadoop生态与分布式计算