sublimeREPL是一个Sublime Text上用来构造Python IDE的很好的一个包。
配置好相应的环境之后,用网上的教程让F5作为一键编译的快捷键:
[
{
\"keys\":[\"f5\"],
\"caption\": \"SublimeREPL: Python - RUN current file\",
\"command\": \"run_existing_window_command\", \"args\":
{
\"id\": \"repl_python_run\",
\"file\": \"config/Python/Main.sublime-menu\"
}
}
]
而这种方式有个缺点,就是每次修改完代码之后必须先Ctrl+S
保存之后,再按下F5
才能编译最新版本的文件。
而Chain Of Command包完美解决了这一问题。
通过Package Control安装该包之后,将User Setting
修改如下,便可实现按下F5
先保存再编译的功能。
{
\"keys\":[\"f5\"],
\"caption\":\"SublimeREPL: save & Python - RUN current file\",
\"command\":\"chain\",
\"args\":
{
\"commands\":[
[\"save\"],
[ \"run_existing_window_command\",{\"id\": \"repl_python_run\",\"file\": \"config/Python/Main.sublime-menu\"}]
]
}
}