首先找到sublimerepl的配置文件。
步骤:Preferences-->Browse Packages-->SublimeREPL文件夹-->config文件夹-->Python文件夹-->Default.sublime-commands(以文本格式打开)
[ { "caption": "SublimeREPL: Python", "command": "run_existing_window_command", "args": { "id": "repl_python", "file": "config/Python/Main.sublime-menu" } }, { "caption": "SublimeREPL: Python - PDB current file", "command": "run_existing_window_command", "args": { "id": "repl_python_pdb", "file": "config/Python/Main.sublime-menu" } }, { "caption": "SublimeREPL: Python - RUN current file", "command": "run_existing_window_command", "args": { "id": "repl_python_run", "file": "config/Python/Main.sublime-menu" } }, { "command": "python_virtualenv_repl", "caption": "SublimeREPL: Python - virtualenv" }, { "caption": "SublimeREPL: Python - IPython", "command": "run_existing_window_command", "args": { "id": "repl_python_ipython", "file": "config/Python/Main.sublime-menu" } } ]
这是repl的配置文件,找到你需要的命令复制下来。
粘贴到Preferences-->Key Bindings User
代码如下
[ { "keys": ["f5"],//这是自己设的快捷键 “” "command": "run_existing_window_command", "args": { "id": "repl_python_run", "file": "config/Python/Main.sublime-menu" } } ]最后保存就行了。