gvim 远程选项卡可以使用命令吗?
我的问题的简化版本是如何实现如下命令。
gvim --remote-tab-silent -c mak
当我运行此命令时,我希望打开一个新选项卡并运行 make 命令。然而实际发生的情况是有两个新选项卡“-c”和“mak”
有办法做到这一点吗?我的最终目标是能够在 vim 中运行这样的命令来给我异步 make 输出。
!gvim --remote-tab-silent -c mak
提前致谢。
--编辑-- 我找到了 --remote 的文档,它解释了如何通过打开文件来执行远程命令。该语法显然适用于远程选项卡。
为了做我想做的事,我现在正在使用
gvim --remote-tab-silent +mak MakeOutput
vim中类似的我可以使用
!gvim --remote-tab-silent +mak 输出
它会自动为我打开文件中的第一个错误,我认为这很方便:)
The simplified version of my question is how can I achieve a command such as the following.
gvim --remote-tab-silent -c mak
When I run this command I am hoping for a new tab to be opened, and to have the make command run. What actually happens however is there are two new tabs "-c" and "mak"
Is there a way to do this? My end goal is to be able to within vim run a command such as this to give me asynchonous make output.
!gvim --remote-tab-silent -c mak
Thanks in advance.
--EDIT--
I found the documentation for --remote, which explains how to do a remote command with opening a file. The syntax applies to remote-tab apparently.
To do what I want I am now using
gvim --remote-tab-silent +mak MakeOutput
Similarly inside vim I can use
!gvim --remote-tab-silent +mak
MakeOutput
It automatically opens the first error in a file for me, which is convenient I would think :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您似乎要问的是如何在更新完成时异步执行命令。
看看我的 AsyncCommand 插件。它只是包装了执行某些内容所需的 vim 语法并使用 --remote 加载它。我上传了包含
AsyncMake
命令的 AsyncCommand 2.0。将脚本添加到您的
.vim/plugin
中,您可以使用:AsyncMake
或:AsyncMake target
进行构建。一旦 make 完成,错误将在您的快速修复中打开。It seems like what you're asking is how to execute commands asynchronously with updates when they complete.
Have a look at my AsyncCommand plugin. It's just wraps the vim syntax required to execute something and load it with --remote. I've uploaded AsyncCommand 2.0 that includes an
AsyncMake
command.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.