Emmet 的 Package Control page 中的 README 清楚地解释了如何执行此操作 - 向下滚动到 How to expand abbreviations with Tab in other syntaxes 部分:
Emmet 仅以有限的语法扩展缩写:HTML、CSS、LESS、SCSS、Stylus 和 PostCSS。将 Tab 处理程序限制为有限语法列表的原因是因为它破坏了本机 Sublime Text sn-ps。
如果您想在其他语法(例如 JSX、HAML 等)中使用 Tab 缩写,您必须调整键盘快捷方式设置:为所需语法范围选择器的 tab 键添加 expand_abbreviation_by_tab 命令。要获取当前语法范围选择器,请按 ⇧⌃P (OSX) 或 Ctrl+Alt+Shift+P ,它将显示在编辑器状态栏中。
转到 Preferences > Key Bindings — User 并插入以下 JSON sn-p 并使用正确配置的范围选择器而不是 SCOPE_SELECTOR 令牌:
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
{
"operand": "SCOPE_SELECTOR",
"operator": "equal",
"match_all": true,
"key": "selector"
},
// run only if there's no selected text
{
"match_all": true,
"key": "selection_empty"
},
// don't work if there are active tabstops
{
"operator": "equal",
"operand": false,
"match_all": true,
"key": "has_next_field"
},
// don't work if completion popup is visible and you
// want to insert completion with Tab. If you want to
// expand Emmet with Tab even if popup is visible --
// remove this section
{
"operand": false,
"operator": "equal",
"match_all": true,
"key": "auto_complete_visible"
},
{
"match_all": true,
"key": "is_abbreviation"
}
]
}
PHP 的SCOPE_SELECTOR 值为embedding.php text.html.basic。