[转]关于Sublime的repl设置

全是转的,出处不详。


SublimeREPL

针对上面的两个问题,我找到了SublimeREPL插件,可以用于运行和调试一些需要交互的程序,同时在Win 7和Win 8.1下面都能正常工作。

比较棒的是这个插件可以支持多种语言,而对于Python也支持多种运行模式,我比较常用到的是Python和Python - RUN current file 。

SublimeREPL添加快捷键

SublimeREPL安装之后没有快捷键,每次运行程序必须用鼠标去点工具栏,有些不爽,所以需要给SublimeREPL添加快捷键。

这里可以看到所有Python方法的名称及id,根据此可以自定义用户快捷键,在偏好–键绑定–用户中输入:

[ {“keys”:[“f5”],
“caption”: “SublimeREPL: Python - RUN current file”,
“command”: “run_existing_window_command”, “args”:
{
“id”: “repl_python_run”,
“file”: “config/Python/Main.sublime-menu”
}}
]
本文仅定义了Python - RUN current file的快捷键,我在这里使用的是F5,可以根据自己的需要进行灵活的调整。

[
{
“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”
}
}
]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值