Skip to content

Instantly share code, notes, and snippets.

@iboard
Created April 21, 2014 06:47
Show Gist options
  • Select an option

  • Save iboard/11134270 to your computer and use it in GitHub Desktop.

Select an option

Save iboard/11134270 to your computer and use it in GitHub Desktop.
Run rspec from vim
" Call rspec from vim
" Apr 21st, 2014 Andi Altendorfer <[email protected]>
"
" RspecLine() ... run rspec for the current cursor line
" RspecFile() ... run rspec for the current file
" RspecAll() .... run entire suite
"
" Copy this file to your ./vim/pluglin directory
function RspecLine()
execute "!rspec -fd %:" . line(".")
endfunction
function RspecFile()
execute "!rspec -fd %"
endfunction
function RspecAll()
execute "!rspec -fd"
endfunction
nmap <c-j>rl :call RspecLine()<CR>
nmap <c-j>rf :call RspecFile()<CR>
nmap <c-j>ra :call RspecAll()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment