因為用sublime運行python,如果有input()函數,ctrl+b是不能輸入數據的,所以下載安裝了sublimeREPL進行調試。
但是sublimeREPL沒有自定義快捷鍵,所以只有自己設置。
網上很多方法但是都沒有效果,最后折騰了一晚上終於找到正確方式。
首先找到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" } } ]
最后保存就行了。
如圖
關於sublime 每次打開更新的提示
preferences->seting user -》
{
"font_size": 13,
"update_check":false,
}