在埃米特的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
。
非常感謝,現在工作得很好。 –