4

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 :)

ostler.c
  • 3,282
  • 3
  • 21
  • 21
  • My solution is still blocking however. If anyone knows how to make it asynchronous that would be even better. – ostler.c Jan 19 '11 at 20:44
  • Vim is not able to run anything asynchronously. Some enthusiasts are working on adding some asynchronous features, but they are far from being pulled into mainstream. – ZyX Jan 19 '11 at 20:48
  • Using `+` instead of `-c` didn't change anything in gvim 7.4 :-( Where is the documentation for `--remote` that you mention? `man gvim` and `gvim --help` didn't say much. – Ciro Santilli OurBigBook.com Apr 22 '17 at 09:39
  • Possible duplicate of [How to send commands to gvim when using --remote?](http://stackoverflow.com/questions/10311254/how-to-send-commands-to-gvim-when-using-remote) – Ciro Santilli OurBigBook.com Apr 22 '17 at 09:53

1 Answers1

0

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.

idbrii
  • 10,975
  • 5
  • 66
  • 107