Last active
January 20, 2019 07:58
-
-
Save iboard/11134399 to your computer and use it in GitHub Desktop.
Vim-functions to run rspec from current file, line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Call rspec from vim | |
" Apr 21st, 2014 Andi Altendorfer <andreas@altendorfer.at> | |
" | |
" 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