vimtricks.wiki Concise Vim tricks, one at a time.

How do I run builds asynchronously in Vim?

Answer

:Make (vim-dispatch)

Explanation

vim-dispatch by Tim Pope provides asynchronous build commands in Vim. It runs :make and similar commands in the background, populating the quickfix list when done.

How it works

  • :Make runs the current makeprg asynchronously
  • :Dispatch command runs any command asynchronously
  • Results go to the quickfix list when the command finishes
  • Vim remains responsive during execution

Example

:Make                      " Async make
:Dispatch python3 %        " Run current file async
:Dispatch! npm test        " Run in background (no quickfix)

Tips

  • Install: Plug 'tpope/vim-dispatch'
  • Uses tmux, terminal, or other backends for async execution
  • :Focus command sets a command to run with :Dispatch
  • :Start command opens a new terminal with the command
  • Pairs well with vim-test for async test running

Next

How do you yank a single word into a named register?