在 vim/gvim 中静默执行 make
我想使用 gvim 启动 make 并为我的代码进行构建。由于构建过程需要一些时间,我希望它以静默方式执行,然后最终向我显示错误/构建日志。
我已将其添加到我的 .vimrc 中
:command -nargs=* Make silent make <args> | cwindow 10
map <c-b> <c-o>:Make<cr>
,因此当我按 Ctrl-b 时,它就开始构建。但是当我这样做时,我的 gvim 挂起,有时我什么也做不了。有没有办法完成我想做的事情。
由于我在 make 末尾使用 cwindow 10
,因此它会启动快速修复窗口。除此之外我还想查看构建日志。我可以这样做吗
I want to use gvim to launch make and do the build for my code. Since the build process takes some time i want it to be silently executed and then in the end errors/build log be showed to me.
i have added this to my .vimrc
:command -nargs=* Make silent make <args> | cwindow 10
map <c-b> <c-o>:Make<cr>
So when i press Ctrl-b it starts building. But when i do that my gvim hangs and i cant do anything for sometime. Is there a way to accomplish what i am trying to do.
Since i am using cwindow 10
at the end of make , it launches the quickfix window. In addition to that i also want to see the build log. Can i somehow do that
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如我在类似问题中所说:看看我的 AsyncCommand 插件。将脚本添加到您的
.vim/plugin
中,您可以使用:AsyncMake
或:AsyncMake target
进行构建。一旦 make 完成,错误将在您的快速修复中打开。对于日志文件,您可以扩展 AsyncMake 以打开构建日志。安装 asynccommand.vim 后,将其添加到您的 vimrc 中:
但是,日志文件和错误窗口将有很多相同的文本,因此您并不总是需要两者。如果您的构建工具已经将其构建日志写入磁盘,那么我建议您让构建输出包含构建日志的完整路径。这样您就可以在错误窗口中的路径上输入
gf
来在必要时跳转到构建日志。As I said in similar questions: Have a look at my AsyncCommand plugin. Add the script to your
.vim/plugin
and you can build with:AsyncMake
or:AsyncMake target
. Errors will be opened in your quickfix once the make completes.For the log file, you could extend AsyncMake to also open the build log. Add this to your vimrc after you've installed asynccommand.vim:
However, the log file and the error window will have a lot of the same text, so you don't always need both. If your build tool already writes its build log to disk, then I'd suggest you have the build output include the full path to the build log. That way you can type
gf
on the path in the error window to jump to the build log when necessary.