vim-dispatch is a plugin by Tim Pope that I’d heard a lot about but never really understood the benefits or what it offered me…until now.
Recently I’ve been working a lot with Makefiles. I’m writing my dissertation in Latex and compiling that through a Makefile, I have a couple of C projects which I’ve similarly used Makefiles to save me time, and I’ve also been using other build tools like Gulp, Grunt, or other command line tools like Bundle.
Essentially, something I have to do quite a lot is quickly drop out of Vim to run something, usually one of the aforementioned tools or often my tests too. The problem with these is that they take my focus out of Vim. Most of the time as well, I only care about the result of the program I ran if something went badly. If everything went OK, I don’t need to know. So taking my focus out of Vim and losing where I was isn’t worth it most of the time.
And that’s where Vim Dispatch comes in. It provides two commands. The first, :Make wraps around Vim’s :make, but runs it asynchronously, in the background. Then, once its done, it populates the quickfix list with any problems or errors. If nothing bad happens, you don’t get disturbed. And, most importantly, at no point is your focus taken from Vim. You can keep typing away and coding as your Make command runs in the background. The output from the command is added to the quickfix window, and the quickfix window is populated with the errors.… Click Here