Created
January 2, 2012 03:53
-
-
Save jpignata/1549224 to your computer and use it in GitHub Desktop.
runs specs in first active terminal from vim
This file contains hidden or 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
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> |
This file contains hidden or 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
#!/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