在Vim中运行脚本(Windows,Ruby)时的烦恼 [英] Annoyance when running scripts in Vim (Windows, Ruby)

查看:55
本文介绍了在Vim中运行脚本(Windows,Ruby)时的烦恼的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始在我的编程项目(主要是Ruby)中使用vim,并且几乎所有内容都能按我的意愿工作,但是编译存在问题。

I started using vim for my programming projects (mostly Ruby) and mostly everything works just as I want but I have a problem with compiling.

让我们说我正在处理Ruby脚本,并且想运行它。我输入:ruby sometging.rb(映射到其他键)。然后,vim打开一个新的cmd.exe窗口并运行 ruby​​ something.rb。然后它等待我按ENTER键关闭窗口并继续使用脚本。

Lets say I am working on a Ruby script and I want to run it. I type :ruby sometging.rb (mapped to some other key). Then vim opens a new cmd.exe window and runs 'ruby something.rb'. Then it waits for me to press ENTER to close the window and continue working on the script.

有没有一种方法可以在Windows上配置vim,以便它始终运行脚本我正在一个单独的窗口中工作(如果不存在,则始终是同一窗口=>打开一个窗口),并且不要求我使用Enter进行确认?

Is there a way to configure vim on windows so that it always runs the script I'm working on in a separete window (always the same one, if none exists => open one), and not ask me to confirm with enter?

推荐答案

这不是很完美,但是我用它来启动Python脚本。

This isn't exactly perfect but I use this to launch Python scripts.

command -nargs = * PY3 !start cmd / K Python.exe%:p< args>

它会启动一个保持活动状态的窗口,并且不会不会干扰我的VIM窗口。不幸的是,它没有将其加载到现有窗口中。

It starts up a window that stays alive and doesn't interfere with my VIM window. Unfortunately it doesn't load it into an existing window.

这篇关于在Vim中运行脚本(Windows,Ruby)时的烦恼的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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