1. 下載並安裝sublime text3
https://www.sublimetext.com/3
2. 安裝package control外掛程式
這個外掛程式用來安裝其他外掛程式的。
參考官網連結說明,進行安裝:https://packagecontrol.io/installation
3. 用package controle: install package 安裝:babel, React-JS, sublimeLinter
4. 按安裝 emmet,並修改emmet 相容jsx檔案
開啟 preferences -> Key bindings - Users,把下面代碼複製到[]內部。
{ "keys": [ "super+e" ], "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 }] }
5. 安裝JS,格式化js代碼
開啟preferences -> Package Settings -> JsFormat -> Setting - Users,輸入以下代碼:
{ "e4x": true, // jsformat options "format_on_save": true,}
即可儲存時自動格式化,並支援 jsx 類型檔案.
參考連結:
http://www.cnblogs.com/terrylin/p/4942332.html