v-yarotsky / related.vim

A better TDD workflow for VIM
http://blog.yarotsky.me/2013-05-05-related-vim
0 stars 0 forks source link

Related.vim

Build Status Coverage Status Code Climate

This plugin allows quick switching between ruby/python tests and sources, and to run related tests synchronously/asynchronously.

Requirements:

Installation:

Using pathogen.vim:

cd ~/.vim/bundle
git clone git://github.com/v-yarotsky/related.vim.git

Usage:

command :RelatedOpenFile opens related file
command :RelatedRunTest runs related test
command :RelatedRunLatestTest runs the most recent test executed
command :RelatedPipe makes the plugin echo test commands to given named pipe
command :RelatedNoPipe makes the plugin run test commands in background (default)

RelatedPipe is useful for GUI MacVim:

$ mkfifo my_tests
$ while true; do sh -c "$(cat my_tests)"; done

in Macvim:

:RelatedPipe my_tests

It's better to have a convenient key mappings for these commands. I defined the following mappings in my .vimrc (I chose leader to be \):

nmap <leader>,, :RelatedRunLatestTest<CR>
nmap ,, :RelatedOpenFile<CR>
nmap , :RelatedRunTest<CR>