Intellij IDEA自定义Live Templates提高编码效率

Intellij IDEA Live Templates

详情见: https://www.cnblogs.com/expiator/p/17380434.html

自定义Live Templates的示例

以下的示例,都是使用首字母,作为关键词。不一定要全打出来,有提示了按enter选取就行。

LIVE TEMPLATE --- list

  • 初始化String类型的list:

Abbreviation:

lsna

Template text:

List<String> $END$List = new ArrayList<>();
  • 初始化Integer类型的list:

Abbreviation:

lina

Template text:

List<Integer> $END$List = new ArrayList<>();

LIVE TEMPLATE --- Map

  • 初始化String, String的 Map:

Abbreviation:

mssnh

Template text:

Map<String, String> $END$Map = new HashMap<>();
  • 初始化String, Integer 的 Map:

Abbreviation:

msinh

Template text:

Map<String, Integer> $END$Map = new HashMap<>();
  • 初始化Integer, Integer 的 Map:

Abbreviation:

miinh

Template text:

Map<Integer, Integer> $END$Map = new HashMap<>();

LIVE TEMPLATE --- Set

  • 初始化String的 Set:
    Abbreviation:
ssnh

Template text:

Set<String> $END$Set = new HashSet<>();
  • 初始化String的 Set:
    Abbreviation:
sinh

Template text:

Set<Integer> $END$Set = new HashSet<>();

posted on   乐之者v  阅读(17)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2019-05-07 SpringCloud Feign的简单运用
2019-05-07 Spring Cloud Feign踩坑记录(二)
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示