我只是想制作一些片段,但我不能让它们中的任何一个工作.有人能看出这有什么问题吗?我阅读了他们的文档,并在网上翻阅了一些例子,但它们也没有用.我已经在我的/sublime text 3/packages/user文件夹中找到它并使用约定命名myTest.sublime.snippet.
该片段是:
<snippet>
<content>
<![CDATA[
<!DOCTYPE html lang="en">
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>${1:test1|test2|test3} | $2</title>
<meta name="viewport" content="width=device-width">
<meta name="Description" lang="en" content="Description">
<meta name="robots" content="index, follow">
<meta name="robots" content="noodp, noydir">
<!-- Twitter Bootstrap -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
$3
</div>
</body>
</html>
]]>
</content>
<tabTrigger>page</tabTrigger>
<scope>source.html</scope>
<description>HTML5 Base HTML</description>
</snippet>
Run Code Online (Sandbox Code Playgroud)
awe*_*oon 11
您应该使用text.html,而不是source.html在scope块.
小智 9
第1步。对于 html 片段,请更改
<scope>source.html</scope>
Run Code Online (Sandbox Code Playgroud)
到
<scope>text.html</scope>
Run Code Online (Sandbox Code Playgroud)
第2步。如果您希望 sublime 在输入关键字后显示工具提示,请添加此行
"auto_complete_selector": true
Run Code Online (Sandbox Code Playgroud)
到您的首选项 - 设置用户文件
| 归档时间: |
|
| 查看次数: |
12590 次 |
| 最近记录: |