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

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

问题描述

我在windows中使用gVim来编辑我的代码(主要是C ++)。我使用:make在gVim编译项目,但这是一个阻塞操作,阻止我使用gVim直到编译完成。我如何做:异步,仍然得到的好处,读取错误回到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是可以切换的自定义命令

( 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&)中将进度重定向到某个文件。然后使用

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从gVim在后台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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