Vim:在持久的 REPL 环境中运行选定的代码 [英] Vim: Run selected code in a persistent REPL-environment

查看:48
本文介绍了Vim:在持久的 REPL 环境中运行选定的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

R、Python、Scala 等都带有 REPL 环境,我不想错过,但是,大多数时候编辑其中的文本很糟糕,所以我在 vim 中编辑代码,粘贴它并查看在输出处再次编辑 vim 中的代码.

R, Python, Scala etc. all come with REPL-environments, which I don't want to miss, however, most of the time editing text in them sucks, so I edit the code in vim, paste it and look at the output and edit the code in vim again.

我可以使用 !python % 运行当前文件,我可以使用更多 vim 魔法运行当前行,但是,这将启动解释器的新进程.

I can run the current file with !python % and I can run the current line with even more vim magic, however, this will start a new process of the interpreter.

是否可以启动 REPL 并将代码行发送到正在运行的 REPL(显然并返回结果)?

Is it possible to start a REPL and send lines of code to the running REPL (and get the results back, obviously)?

推荐答案

也许你需要这两个插件之一:

Maybe one of these two plugins is what you need:

这篇关于Vim:在持久的 REPL 环境中运行选定的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆