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
:Makeruns the currentmakeprgasynchronously:Dispatch commandruns 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 commandsets a command to run with:Dispatch:Start commandopens a new terminal with the command- Pairs well with vim-test for async test running