在后台运行 :make from gVim [英] Running :make from gVim in Background

查看:20
本文介绍了在后台运行 :make from gVim的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 中使用 gVim 来编辑我的代码(主要是 C++).我在 gVim 中使用 :make 来编译项目,但这是一个阻塞操作,它阻止我在编译完成之前使用 gVim.我该怎么做 :make asynchronously 并仍然获得将错误读回 Vim 并跳转到源代码中的错误的好处?如果我能实时看到制作过程,我会加分.现在 :make 将输出重定向到一个文件中,因此我看不到 make 的进度.

I use gVim in windows to edit my code (mostly C++). I use :make in gVim to compile the project, but this is a blocking operation, that prevents me from using gVim until the compilation is complete. How can I do :make asynchronously and still get the benefits of reading the errors back into Vim and jump to the errors in source code? Bonus points if I get to see the make process in real time. Right now the :make redirects the output into a file, hence I don't get to see the progress of make.

推荐答案

我要做的是

:!gvim -c 'MyMake'

(其中 MyMake 是自定义命令,可以切换到适当的目录、make 和 copen 20.)

( where MyMake is the custom command which can switch to appropriate dir, make, and copen 20. )

当构建进入另一个窗口时,我正在做我的工作.

and I am doing my job while build goes in the other window.

其他选项:
您可以从 shell 或在 vim (:!make&) 中将 make 进度重定向到某个文件.然后通过使用

Other option:
You can redirect make progress to some file from the shell or within vim (:!make&). And then by using

:cfile make_result_file

:cw
 or
:copen 20 

获得与使用 :make 相同的结果

Achieve the same result as you'd use :make

这篇关于在后台运行 :make from gVim的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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