如何在 Sublime Text 3 中为 Markdown 启用 Emmet?

3

最近,我在Sublime Text 3中使用Emmet的标签展开功能时出现了问题。 我仍然可以按下Ctr+Shift+P并输入:"Emmet: Expand abbreviation"。 但是当我只按下TAB键时它就不起作用了。

我如何在Markdown文件中使用tab触发缩写展开?

我尝试过的方法

我添加了以下内容到我的键绑定中,但没有任何效果:

{"keys": ["tab"], "args": {"action": "expand_abbreviation"}, "command": "run_emmet_action", "context": [{"key": "emmet_action_enabled.expand_abbreviation"}]}
1个回答

0

您需要手动将Markdown范围添加到Emmet设置中。

  1. 打开首选项 -> 包设置 -> Emmet -> 设置
  2. 将左侧的abbreviation_scopes部分复制到右侧,并添加此行:

"text.html.markdown",

我的用户设置现在看起来是这样的:

{
    "abbreviation_scopes": [
        "text.html.markdown",
        "(text.html | text.xml) - source - meta - comment",
        "source.sass - meta.property-value - meta.property-name - string - punctuation - comment",
        "(source.css | source.scss | source.less | source.postcss | source.stylus) & meta.property-list",
        "(source.css | source.scss | source.less | source.postcss | source.stylus) - meta.property-value - meta.property-name - string - comment",
        "(source.tsx | source.js | source.jsx) - comment",
        "text.html.cfml - meta.tag",
        // Inline CSS
        "text.html meta.attribute-with-value.style (string.quoted | source.css)"
    ],
}

现在Markdown中可以使用Tab键进行缩进了。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接