Thursday, October 17, 2013

Re: capture output of a vim command into a quickfix windows without freezing vim

On Thursday, October 17, 2013 3:59:30 PM UTC-5, Gary Johnson wrote:
>
> I looked at ":help remote.txt" but didn't see anything there that
>
> would do what you want, but I don't use the client-server
>
> functionality so I could easily be wrong about that.
>
>

Not directly, but you can call arbitrary Vim functions with --remote-expr

>
> The easiest "solution" is to run your make command in a different
>
> Vim instance.
>
>
>
> Another approach is to run make in the background and send its
>
> output to file. Then, when that make is done, you can use :cfile
>
> command to open that file in a quickfix window.
>
>

Yes, I'd suggest this approach. But you don't need to do the :cfile manually.

http://vim.wikia.com/wiki/Execute_external_programs_asynchronously_under_Windows gives a method on Windows for async grep commands. The idea would be the same for "make" commands.

You shell out to start a command in a background process that will do the compile, AND when that compile is done will use --remote-expr to tell Vim to load a file with :cfile.

There are also some plugins out there to simplify the task I think.

Note, the quickfix window will not update dynamically as the compile happens. But it will allow you to keep using Vim while it is going on.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment