sublime 3 使用Snippets创建代码片段

2023-06-12,,

选择菜单 Tools -> new snippet...

<snippet>

<content><![CDATA[

some code write here '${1:highlight}'

]]></content>

<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->

<tabTrigger>tt</tabTrigger>

<!-- Optional: Set a scope to limit where the snippet will trigger -->

<!-- <scope>source.php</scope> -->

</snippet>

可以通过设置快捷键快速显示,如上,输入tt后按tab键即可显示出来,或选择菜单Tools -> Snippets... 在列表里选择

保存时存放在\Packages\User目录下,后缀名必须为 .sublime-snippet

《sublime 3 使用Snippets创建代码片段.doc》

下载本文的Word格式文档,以方便收藏与打印。