如何在vim中设置go-gb以进行构建

huangapple go评论75阅读模式
英文:

How can I setup go-gb to build inside of vim

问题

有人在vim中将go-gb设置为您的makeprg吗?有各种关于配置makeprg编译c代码的文档,但是我找不到关于配置新命令的文档。

理想情况下,我希望能够在vim中运行:make命令并利用errorformat来构建。

set errorformat=%D(in\ %.%#)\ building\ pkg\ "%f",%f:%l:\ %m%.%#,%-G%.%#

英文:

Has anyone setup go-gb as your makeprg in vim? There is all sorts of documentation on configuration makeprg for compiling c code, but now much that I can find on configuring new commands.

Ideally i'd be able to run the :make command from vim and utilize errorformat on my builds.

set errorformat=%D(in\ %.%#)\ building\ pkg\ \"%f\",%f:%l:\ %m%.%#,%-G%.%#

答案1

得分: 1

为了在vim中将gb作为你的makeprg使用:

$ cd mygodir
$ vi main.go
#在vi中
# :set errorformat=%D(in\ %.%#)\ building\ pkg\ \"%f\",%f:%l:\ %m%.%#,%-G%.%#
#然后
# :set makeprg=gb
#现在
#:mak
#将像往常一样工作。
英文:

In order to use gb as your makeprg in vim:

$ cd mygodir
$ vi main.go
#inside vi
# :set errorformat=%D(in\ %.%#)\ building\ pkg\ \"%f\",%f:%l:\ %m%.%#,%-G%.%#
#and then
# :set makeprg=gb
#now
#:mak
#will work as usual.

huangapple
  • 本文由 发表于 2012年1月11日 12:58:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/8814366.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定