Skip to content

Instantly share code, notes, and snippets.

@jpignata
Created January 2, 2012 03:53
Show Gist options
  • Save jpignata/1549224 to your computer and use it in GitHub Desktop.
Save jpignata/1549224 to your computer and use it in GitHub Desktop.
runs specs in first active terminal from vim
function! RSpec(args)
execute ":silent ! run-in-terminal.applescript 'rspec " . a:args . " %'"
endfunction
" command-R to run a focused spec
map <D-R> :call RSpec("-l " . <C-r>=line('.')<CR>)<CR>
" command-r to run all specs
map <D-r> :call RSpec("")<CR>
#!/usr/bin/env osascript
on run argv
tell application "Terminal"
if (count of windows) is 0 then
do script argv
else
do script argv in window 1
end if
activate
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment