sublimeREPL插件應(yīng)該是很多用sublime寫python的用戶的必備插件。最近配置該插件時(shí),設(shè)置好快捷鍵發(fā)現(xiàn)按 ‘F5’沒有反應(yīng)。找了半天終于找到了解決方案,這里記錄一下。
這個(gè)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"}
}
不幸的是,我按這個(gè)去配置,按對(duì)應(yīng)快捷鍵去無法啟動(dò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"}
},
} ,
保存,重啟。