Remote gvim tab with command option?

A simplified version of my question is how can I get a command like the following.

gvim --remote-tab-silent -c mak 

When I run this command, I hope to open a new tab and run the make command. However, there are actually two new tabs: "-c" and "mak"

Is there any way to do this? My ultimate goal is to be able to run such a command inside vim to give me asynchronous output.

 !gvim --remote-tab-silent -c mak 

Thanks in advance.

- EDIT - I found documentation for --remote that explains how to make a remote command with opening a file. The syntax seems to apply to the remote tab.

To do what I want, I now use

 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 the file for me, which is convenient, I would think :)

+4
source share
1 answer

It seems that you are asking how to execute commands asynchronously with updates when they complete.

Check out my AsyncCommand plugin. It simply wraps the vim syntax needed to accomplish something, and loads it with --remote. I downloaded AsyncCommand 2.0, which includes the AsyncMake team.

Add a script to your .vim/plugin , and you can build with :AsyncMake or :AsyncMake target . Errors will open in your quickfix after make is complete.

0
source

Source: https://habr.com/ru/post/1336204/


All Articles