xcode 用 vim 中的自定义脚本替换 :make 命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/809589/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:33:26  来源:igfitidea点击:

Replace the :make command with a custom script in vim

xcodemacosvimmakefile

提问by Grant Limberg

I use MacVim as my editor within Xcode. By default Command-B and :make are bound to call 'make' from the command line. As we're using Xcode for building and project configuration, I'd like to replace the :make/Command-B calls to make with an applescript command. Is this possible, and how would I go about doing it?

我在 Xcode 中使用 MacVim 作为我的编辑器。默认情况下,Command-B 和 :make 必须从命令行调用 'make'。由于我们使用 Xcode 进行构建和项目配置,我想用 applescript 命令替换 :make/Command-B 调用。这可能吗,我将如何去做?

回答by DanM

Try :help makeprg

试试 :help makeprg

You use :set makeprg=xxx to change the command that is executed.

您使用 :set makeprg=xxx 来更改执行的命令。

回答by riko

In order to run an XCode build from CLI, the command is xcodebuild. I have never tried it inside vim, though.

为了从 CLI 运行 XCode 构建,命令是 xcodebuild。不过,我从未在 vim 中尝试过。