-2
<snippet>
    <content>
        <!doctype html>
<html>

<head>
        <style type = "text/css">

        </style>
</head>

<body>
        <script type = "text/javascript">

        </script>
</body>

</html>
    </content>
    <tabTrigger>html_t</tabTrigger>
    <description>html_css_javascript</description>
    <scope>html</scope>
</snippet>

when i save it as h.sublime-snippet, I get the error "No content for Snippet Packages /User/h.sublime-snippet"

4

2 回答 2

3
<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>

如果您将自己的代码与此示例中的代码进行比较,您会发现您的代码缺少一些关键组件——例如,<![CDATA[您的 html 代码,然后]]>

于 2013-05-18T15:04:59.057 回答
0

这是一个通过点击 c+tab 触发的片段(html 注释)的示例:

<snippet>
    <content><![CDATA <!-- ${1:comment} -->]</content>
    <!-- Optional: Tab trigger to activate the snippet -->
    <tabTrigger>c</tabTrigger>
    <description>Snippet to make fast html comment</description>
</snippet>
于 2013-12-04T00:38:52.083 回答