安装Babel插件语法转义
ctrl+shift+p->install package->Babel
可以支持ES6和JSX语法
安装JsFormat (可以不安,无影响)
Preferences->Package Settings->JsFormat->Settings-User
中加入以下代码,可以支持JSX格式化
{
"e4x": true,//支持jsx格式化
"format_on_save": true//保存立即格式化,看个人喜好
}
设置Emmet 可自动补全代码
Preferences->Key Bindings - User
加入以下代码
[{
"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": "source.js",
"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"
}
]
}]
哎呀,代码自动补全了,开心
参考了https://github.com/sergeche/emmet-sublime#tab-key-handler