Sublime Text自定义代码片段Code Snippets
2023-09-27 14:24:04 时间
Mac
菜单栏 -> Tools -> Developer -> new snippet…
新文件的内容
<snippet>
<content><![CDATA[
Hello, ${1:this} is a ${2:snippet}.
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
修改第三行内容
<snippet>
<content><![CDATA[
String ${1}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>str</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.java</scope>
</snippet>
1、${1}
进入页面后, 光标移入的位置
2、<tabTrigger>str</tabTrigger>
tab触发的标识 输入 str
+ tab 自动补全 为 String
3、<scope>source.java</scope>
生效文件,此处在java文件生效
4、保存文件为 str.sublime-snippet
回到java文件,输入 str
+ tab 自动补全 为 String
相关文章
- Visual Studio Code is not showing the ouput of Python
- Setting Margin Properties in code
- VS Code比较不同版本项目的两个代码文件差异 添加到加入工作区很有用
- visual studio code常用插件
- The "Go" Learning Trip -- 1. Hello Go, Frist “go” Code -- Part1-1
- Visual Studio Code 调试 nodejs (断点调试、自动重启、进程调试)
- 关于vs code文本编辑器的快捷键
- 【HMS Core】运动健康服务发起授权失败 code=50063
- Code First开发系列之管理并发和事务
- 2021年新书推荐之《Read Write Code阅读编写代码》代码就是未来的书籍
- linux网卡出现问题:Job for network.service failed because the control process exited with error code问题
- Visual Studio Code 与 Win10 64bit Ubuntu bash 的ESP8266 编译开发环境搭建(无需编译toolchain)
- STM32keil设置中的宏定义STM32F10X_MD,USE_STDPERIPH_DRIVER作用以及用VS Code编写stm32代码配置问题
- 从Script到Code Blocks、Code Behind到MVC、MVP、MVVM