Dispatch plugin for Vim


Vim can be used to build your code by using the :make command. It runs the command appropriate for your compiler, parses the compile errors or warnings and provides them in the Quickfix window. The only problem with this is that the build process is synchronous: the build command takes over the terminal and until it is over you can neither view nor interact with Vim.

The Dispatch plugin by Tim Pope enables you to run the build command asynchronously. The plugin can be installed from source here. You have two choices: run the build command asynchronously in the foreground or in the background.

  • Run :Make to run the build asynchronously in the foreground. This is possible only if you are using a terminal multiplexer like Tmux. A split terminal opens up at the bottom and you can see the output of your build there. The focus remains in Vim and you can view and interact with the editor while the build carries on. If you are running Vim in a normal terminal, this command just runs the plain old :make synchronously.

  • Run :Make! to run the build asynchronously in the background. This can be run on Vim running in any setup. The build command runs in the background invisibly and you can view and interact with Vim while this is happening.

  • Run :Copen to view the build output either during the build or after it is complete in foreground or background.

I highly recommend this plugin for anyone who is already using :make since with no change you can now build asynchronously.

Tried with: Vim 7.4 and Ubuntu 14.04

One thought on “Dispatch plugin for Vim

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.