希望可以让 sublime 自动补全jsx 标签,如下图
但是参考了Sublime3 玩转 ES6+ReactJs里面配置 Emmet 的做法,没有起到效果。
菜单->Preferences->Key Bindings - User
是这样的:
[{
"keys": [
"tab"
],
"args": {
"action": "expand_abbreviation"
},
"command": "run_emmet_action",
"context": [{
"key": "emmet_action_enabled.expand_abbreviation"
}]
}, {
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
"context": [{
"operand": "source.js",
"operator": "equal",
"match_all": true,
"key": "selector"
}, {
"key": "preceding_text",
"operator": "regex_contains",
"operand": "(\\b(a\\b|div|span|p\\b|button)(\\.\\w*|>\\w*)?([^}]*?}$)?)",
"match_all": true
}, {
"key": "selection_empty",
"operator": "equal",
"operand": true,
"match_all": true
}]
}]
1
NicholasNC OP 不是很懂,今天卸掉了 Emmet ,然后重新安装。
神奇的居然可以了 |