Squishy thoughts— crazy in small doses

Using Dispatch in Neovim

October 27, 2015

I’ve made a neovim plugin for the vim plugin dispatch.vim. Confused? I’ll explain.

For a long time, my development workflow consisted of tmux with vim and a couple of terminals. I usually compiled or ran tests in one terminal and used the other terminal for managing files, git or whatever else I needed to do. Eventually, I began moving things into vim using plugins.

One useful plugin was test.vim which allows you to run tests from inside vim, which you then can map to convient keys. test.vim has built-in support for dispatch.vim, a plugin which supports running things in the background using a few different methods, one of them being tmux. test.vim combined with dispatch.vim will run your tests in a new tmux window which is opened and closed as needed. Thus you can continue working while your tests are running. This gave me a great, uninterrupted workflow.

The only thing that bothered me now was the fact that the only thing I used tmux for was to let dispatch.vim do it’s thing. Could I get rid of tmux somehow?

Enter Neovim, a fork of vim attempting to clean up, modernize and modularize vim. Two of the things they have implemented are embedded terminals and background jobs. With these two features I figured I could replicate what dispatch.vim used tmux for.

So I did.

The result is dispatch-neovim. It’s an addon to dispatch.vim, so if you’re using that plugin and would like to use it with neovim, I suggest you check it out.

Tags: programming, vim, vim-dispatch