打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
sublimeREPL快捷键F5无响应问题_sublimerepl快捷键无法运行

sublime从台式移植来笔记本,按F5开交互突然没反应了。

找了不少帖子,国内有效的解决贴是这个:Sublime插件sublimeREPL快捷键无响应问题。但是没有提到原因。

把这段(旧代码)

  1. {
  2. "keys": ["f5"],
  3. "caption": "SublimeREPL: Python - RUN current file",
  4. "command": "run_existing_window_command",
  5. "args": {
  6. "id": "repl_python_run",
  7. "file": "config/Python/Main.sublime-menu"
  8. }
  9. },

换成这段(新代码)就行了。具体原因我还在google(查明了,请往下看)

  1. {
  2. "keys": ["f5"],
  3. "command": "repl_open",
  4. "caption": "Python - RUN current file",
  5. "id": "repl_python_run",
  6. "mnemonic": "R",
  7. "args": {
  8. "type": "subprocess",
  9. "encoding": "utf8",
  10. "cmd": ["python", "-u", "$file_basename"],
  11. "cwd": "$file_path",
  12. "syntax": "Packages/Python/Python.tmLanguage",
  13. "external_id": "python",
  14. "extend_env": {"PYTHONIOENCODING": "utf-8"}
  15. },
  16. } ,

--------------------------------------2021/3/10------------

新代码的出处是旧代码里的这个文件"file": "config/Python/Main.sublime-menu"

  
  
  
  

文件中的一段"caption": "Python - RUN current file"的那段

在stackflow上找到答案了:https://stackoverflow.com/questions/55198793/cant-run-py-files-by-using-hot-key-in-sublimetext3

原来是因为旧代码里的"run_existing_window_command"被新版本sublime弃用了

It appears that Sublime Text 3 build 3200 has broken the run_existing_window_command command. .... From this directory, if you open SublimeREPL/config/Python/Main.sublime-menu, you'll see a big ole json file that looks something like this:就像上面这张截图 ...Notice that the innermost children key is a list of dictionaries with commands and args. We're going to copy those into the sublime-keymap file and replace the command and args that are already there.

现在直接在sublime_menu里找一段,复制到key binding,开头加上自己要的快捷键 就能直接用了。 就像新代码那样

 ----------------------------结案----------------------寻找过程小结----------------------------

 因为两台电脑都是前几年不同时间装的sublime,一时忽略了版本的问题。

也去找过是不是repl的原因,但repl/config/python/Main.sublime-menu从2015开始就没修改过了:https://github.com/wuub/SublimeREPL/blob/master/config/Python/Main.sublime-menu

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
解决不能在Sublime Text3中使用input函数输入内容的问题
基于Sublime Text搭建Python IDE | 自由的风
sublime text 3 打造python3环境(代码自动补全,运行程序,高亮显示)
SubLime Text 3 配置SublimeREPL来交互式调试程序
Sublime text 3搭建Python开发环境及常用插件安装
sublime text
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服