安裝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