Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ruby << ENDRUBY
- require 'rubygems'
- require 'appscript'
- include Appscript
- class ITerm
- class << self
- def activate;
- @iterm ||= app('iTerm')
- end
- def write(cmd)
- @iterm.current_terminal.sessions.write(:text => cmd)
- end
- end
- end
- class MacVim
- class << self
- def activate
- @app ||= app('MacVim')
- @app.windows.first.activate
- end
- end
- end
- ENDRUBY
- fun! ITermWrite(cmd)
- ruby << ENDRUBY
- cmd = VIM::evaluate('a:cmd')
- ITerm.activate
- ITerm.write(cmd)
- MacVim.activate
- ENDRUBY
- endfun
Add Comment
Please, Sign In to add comment