Closed jsborjesson closed 7 years ago
Using a custom command would likely do the trick.
Is it possible to do this on a per-run basis? I want the normal output most of the time, but a special binding to do it again more verbosely. Perhaps I can write a function that sets the custom command, then runs it, then changes it back...
Was actually very easy to do it this way - don't know why I didn't think of it before:
" .vim/after/ftplugin/ruby.vim
let g:rspec_command = 'call VtrSendCommand("bundle exec rspec {spec}")'
nnoremap <buffer> <Leader>a :call RunAllSpecs()<CR>
nnoremap <buffer> <Leader>l :call RunLastSpec()<CR>
nnoremap <buffer> <Leader>L :call RunLastSpecWithDocumentation()<CR>
nnoremap <buffer> <Leader>s :call RunNearestSpec()<CR>
nnoremap <buffer> <Leader>t :call RunCurrentSpecFile()<CR>
function! RunLastSpecWithDocumentation()
let l:old_rspec_command = g:rspec_command
let g:rspec_command = 'call VtrSendCommand("bundle exec rspec {spec} --format=documentation")'
call RunLastSpec()
let g:rspec_command = l:old_rspec_command
endfunction
Hello! I use this plugin probably a thousand times per day, and I often find myself thinking "I would like to run the last selected specs, but with
--format=documentation
. Is this possible somehow? Being able to pass the rspec flags toRunLastSpec()
as an argument would be great, but maybe there is an easier way to do this.Any pointers are appreciated!