sublime封装代码片段

1.sublime中tool---->new snippet

将需要复用的进行写在CDATA里,进行保存--->Data下的self(自己新建的)进行保存

2.<tabTrigger>hScript</tabTrigger>改成自定义名称

3.在引用的时候直接hScript+tab   即可加载出自定义的数据

<snippet>

<content><![CDATA[

<!-- Hello, ${1:this} is a ${2:snippet}. -->

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Document</title>

<script type="text/javascript">

${1:this} 

</script>

</head>

<body>

${2:this} 

</body>

</html>

]]></content>

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

<tabTrigger>hScript</tabTrigger>

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

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

</snippet>

相关推荐