sublimeREPL插件应该是很多用sublime写python的用户的必备插件。最近配置该插件时,设置好快捷键发现按 ‘F5’没有反应。找了半天终于找到了解决方案,这里记录一下。
这个user配置是网上最常见的,一搜一大片
{
"keys":["f5"],
"caption": "SublimeREPL: Python - RUN current file",
"command": "run_existing_window_command", "args": {"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"}
}
不幸的是,我按这个去配置,按对应快捷键去无法启动交互界面。
下面是更新后的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"}
},
} ,
保存,重启。