apple swift in terminal

  • alias

    swift='/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -sdk /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'
    

命令行build

    swift hello.swift

命令行run

    swift -i hello.swift
  • ~/bin/swiftrun

    xcrun /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -sdk /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -i $1
    
  • ~/bin/swiftbuild

    xcrun /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -sdk /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk $1
    
  • ~/.vimrc

    Bundle 'toyamarinyon/vim-swift'
    
    " apple swift {{{
    augroup ft_swift
        au!
        au BufRead,BufNewFile *.swift set filetype=swift
        au Filetype swift setlocal makeprg=swiftbuild\ %
        au Filetype swift nnoremap <leader>r :!~/bin/swiftrun %<CR>    
    
    augroup END
    " }}}
    

你可能感兴趣的:(apple,swift)