Toggles betwixt source and unit test file
Use this plug-in when you are doing Test-Driven Development [TDD] in any
language to quickly switch between unit-test and production code. To make this
really fast, bind the TUT command to a function key in your $VIMRC
:
[F3] toggles between (header, ) source and test files.
nnoremap <F3> :<C-U>TUT<CR>
This plug-in assumes source and unit test files are in the same directory.
I recommend installing pathogen.vim, and then simply copy and paste:
cd ~/.vim/bundle
git clone git://github.com/johnsyweb/vim-tut.git
vim -cHelptags -cq
Once help tags have been generated, you can view the manual with:
:help toggle_unit_tests
:TUT
Toggles betwixt source and unit test file
<Leader>tut
Calls :TUT
.
By default, unit-test filenames are deemed to begin with 't_'.
Tell toggle_unit_tests.vim your own prefix by setting the following global
variable, perhaps in $VIMRC
:
let g:unit_test_prefix='test_'
If you find this plug-in useful, please follow this repository on GitHub and vote for it on vim.org. If you have something to say, you can contact johnsyweb on Twitter and GitHub.