sublimeREPL插件應(yīng)該是很多用sublime寫python的用戶的必備插件猫态。最近配置該插件時滚婉,設(shè)置好快捷鍵發(fā)現(xiàn)按 ‘F5’沒有反應(yīng)。找了半天終于找到了解決方案瓣戚,這里記錄一下镐牺。
這個user配置是網(wǎng)上最常見的炫掐,一搜一大片
{
"keys":["f5"],
"caption": "SublimeREPL: Python - RUN current file",
"command": "run_existing_window_command", "args": {"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"}
}
不幸的是,我按這個去配置任柜,按對應(yīng)快捷鍵去無法啟動交互界面卒废。
下面是更新后的user文件
{
"keys": ["f5"],
"command": "repl_open",
"caption": "Python - RUN current file",
"id": "repl_python_run",
"mnemonic": "R",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["python", "-u", "$file_basename"],
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"extend_env": {"PYTHONIOENCODING": "utf-8"}
},
} ,
保存,重啟宙地。