Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
I often have a ton of tests open in one buffer. They're usually related to something I'm refactoring:
vim $(ack -l --perl 'api/v1/episode' t/)
So it's handy to be able to execute all tests in my current vim buffers. Now I can just type
map <leader>tb
:call RunTestsInBuffers()<cr>
function! RunTestsInBuffers()
let i = 1
let tests = ''
while (i <= bufnr("$"))
let filename = bufname(i)
if match(filename, '\.t$') > -1
let tests = tests . ' "' . filename . '"'
endif
let i = i+1
endwhile
if !strlen(tests)
echo "No tests found in buffers"
else
execute ':!prove ' . tests
endif
endfunction
Collecting? (Score:2)
Are you gathering all of these vim-scripts/tips in one place? Because if not, you really should. I'm more and more tempted to start using vim over emacs, with each new one of these you post...
--rjray
Re: (Score:2)
I'm not collecting them directly, but I use a careful Google search to find them [google.com].
Re: (Score:1)
Perfect opportunity to take GitHub for a spin. ;-)
writing buffers with changes (Score:1)
Mmh, this gives me an idea for writing all changed buffers, something for which I don't think there is an in-built vim command.
Re: (Score:1)
Eh? How about
:wa?