【win10】Sublime Text3安裝SublimeREPL外掛以及快捷鍵設定
阿新 • • 發佈:2018-12-20
1、安裝SublimeREPL
手動安裝,在github上面下載,然後放到下面的資料夾裡面就可以:
2、配置快捷鍵
之前在網站上面看了很多教程,發現都無法繫結快捷鍵,按了f5沒有任何反應。後面我修改了一下就可以成功綁定了:(不知道修改原理,勿噴)
- 在剛剛的工具包裡面找到Main.sublime-menu
目錄:\SublimeREPL-master\config\Python
用sublime開啟,找到下面兩段:
“caption”: “Python - PDB current file”,————用於除錯
“caption”: “Python - RUN current file”,————用於執行
- 下面繫結快捷鍵
開啟後,輸入下列程式碼即可: (F5——執行;F8——除錯。具體哪個按鍵可以根據需要修改)
[ {"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"} } }, { "keys": ["f8"], "command": "repl_open", "caption": "Python - PDB current file", "id": "repl_python_pdb", "mnemonic": "D", "args": { "type": "subprocess", "encoding": "utf8", "cmd": ["python", "-i", "-u", "-m", "pdb", "$file_basename"], "cwd": "$file_path", "syntax": "Packages/Python/Python.tmLanguage", "external_id": "python", "extend_env": {"PYTHONIOENCODING": "utf-8"} } }, ]
其實,就是把上面找到的內容複製貼上到按鍵繫結這裡。