Skip to content

Instantly share code, notes, and snippets.

@yamaya
Last active December 11, 2015 16:58
Show Gist options
  • Save yamaya/4631251 to your computer and use it in GitHub Desktop.
Save yamaya/4631251 to your computer and use it in GitHub Desktop.
VimからXcodeでActiveなtargetをRunする
function! <SID>XcodeRunCurrentTarget()
let l:apple_script = 'tell application "Xcode"'
\. "\n". ' activate'
\. "\n". ' tell application "System Events"'
\. "\n". ' key code 15 using {command down}'
\. "\n". ' end tell'
\. "\n". 'end tell'
call system(printf("osascript -e '%s'", l:apple_script))
endfunction
nnoremap <buffer> <F5> :call <SID>XcodeRunCurrentTarget()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment