在埃米特的Package Control page自述解释清楚如何做到这一点 - 向下滚动到How to expand abbreviations with Tab in other syntaxes
部分:
埃米特扩大在有限的语法只有缩写:HTML,CSS,LESS,SCSS,手写笔和PostCSS。将Tab处理程序限制为有限语法列表的原因是因为它打破了原生Sublime Text片段。
如果您想在其他语法中使用Tab缩写(例如,JSX,HAML等),您必须调整键盘快捷键设置:添加expand_abbreviation_by_tab
命令用于所需语法范围选择器的Tab键。为了得到当前的语法范围选择,按⇧^P(OSX)或按Ctrl + Alt键+移+P,它会显示在编辑器状态栏。
转到Preferences > Key Bindings — User
并插入以下JSON片断与适当配置的范围选择,而不是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
。
非常感谢,现在工作得很好。 –