如何在 vim 中运行 make 并在拆分窗口中打开结果? [英] How to run make in vim and open results in a split window?

查看:16
本文介绍了如何在 vim 中运行 make 并在拆分窗口中打开结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 vim 进行编码.当我必须编译当前文件时,目前我使用 :!g++ % &&./a.out:make.当我按下回车键并返回文件时,显示的错误/输出消失了.我希望错误和输出显示在旁边的垂直分割中.如果输出和错误流在不同的缓冲区中,那就太好了.如何才能做到这一点?再次编译时应更新错误和输出缓冲区,并且不应创建新缓冲区.怎么能做到这一点?一些vim插件/功能?还是单线:P?

I use vim for coding. When I have to compile the current file, Currently I use :!g++ % && ./a.out or :make. The errors/output displayed are gone when I press enter and get back to the file. I wish the errors and output are displayed in a vertical split by the side. It would be nice if output and error streams are in separate buffers. How can this be done? Errors and Output buffer(s) should be updated when I compile again and it should not create new buffers. How can do this? some vim pluggin/function? or a oneliner :P?

推荐答案

oneliner:

:make | copen

参见 http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix-window

这篇关于如何在 vim 中运行 make 并在拆分窗口中打开结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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