如何在安装了 Emmet 的情况下制作 Sublime Text 片段 [英] How to make a Sublime Text snippet work with Emmet installed
问题描述
我正在尝试在 Sublime Text 3 中制作一个仅适用于 CSS 文件的片段.这是我拥有的片段:
I am trying to make a snippet in Sublime Text 3 that only applies to CSS files. This is the snippet I have:
<snippet>
<content><![CDATA[/*
Theme Name: ${1:Theme name here and so on...}
Theme URI:
Author:
Author URI:
Description:
Version: 1.0.0
License:
License URI:
Text Domain:
Tags:
*/]]></content>
<tabTrigger>xyz</tabTrigger>
<scope>source.css</scope>
</snippet>
问题是如果我打开一个 CSS 文件,输入 xyz
并点击 tab 我将得到的只是 xyz: ;
.所以似乎 Sublime Text 已经分配了 tab 来插入 : ;
而不是我的片段.
The problem is if I open a CSS file, type xyz
and hit tab all I will get is xyz: ;
. So it seems as if Sublime Text has already assigned the tab to insert : ;
instead of my snippet.
如果我删除插件包Emmet,则不会出现此问题.
This problem does not occur if I remove the plugin package Emmet.
我怎样才能让这个片段起作用?
How can I get this snippet to work?
推荐答案
http://github.com/sergeche/emmet-sublime#tab-key-handler,建议通过在启用 Emmet 的情况下添加以下首选项,应该可以使代码片段在 CSS 文件中工作Emmet 首选项文件:
The documentation at http://github.com/sergeche/emmet-sublime#tab-key-handler, suggests that it should be possible to get snippets to work in CSS files with Emmet enabled by adding the following preference in your Emmet preferences file:
"disabled_single_snippet_for_scopes": "source.css"
这篇关于如何在安装了 Emmet 的情况下制作 Sublime Text 片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!