在VIM中执行make后可以到错误处吗?
在编译 C 或 C++
项目时,我可以转到错误行吗?通常是通过执行 make
,并解析错误字符串,并转到特定文件,以及有错误的行。
已经有可用的插件了吗?
Can i go to the line of error , while compiling a C or C++
project ? Usually by executing make
, and parse the error string , and go to the specific file , and the line with errors.
Is there already an usable plugin ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,这已经内置到 vim 中了。输入
:make
后,输入:cwindow
以显示错误列表。然后,您可以使用此窗口导航到错误。Yeah this is already buit into vim. After typing
:make
type:cwindow
to bring up the error list. You can then navigate to the errors using this window.您也可以在
:mak
或:make
之后执行:cope
打开包含编译器输出的窗口,完成后: clo 来关闭它。
使用
:cn
和:cp
跳转到下一个和上一个错误,或者当您在窗口中时,转到包含文件名、行和错误的错误行。列并按 Enter 键跳转到那里。You can as well after
:mak
or:make
do:cope
to open the window with compiler output and once you are done:clo
to close it.Use
:cn
and:cp
for jumping to next and previous error or when you are in the window go to line that has the error with file name, line & column and press enter to jump there.IIRC,此功能内置于 vim 中。谷歌快速搜索发现了这个有用的链接。这描述了 vim 在 make 后导航错误的功能。
IIRC, this functionality is built into vim. A quick google search revealed this useful link. This describes vim's features for navigating the errors after a make.