How can I send selected text (or a line) in TextMate to R running on Terminal

泪湿孤枕 提交于 2019-11-30 07:39:37

Here is the exact TextMate command that I currently use. Hope it helps!

rawText="$(cat | sed 's/ / /g;')" 

osascript  -e 'on run(theCode)' \
           -e '  tell application "Terminal"' \
           -e '    do script theCode in window 1' \
           -e '  end tell' \
           -e 'end run' -- "$rawText"

open "txmt://open?line=$(($TM_LINE_NUMBER+1))&column=1000000" &

TextMate is MacOS, right? Is so, then this is from the R ?connections page:

"Mac OS X users can use pipe("pbpaste") and pipe("pbcopy", "w") to read from and write to that system's clipboard."

You can "paste" from R-Clipboards into Terminal sessions. You can also send file content from TextMate: http://manual.macromates.com/en/shell_commands#executing_commands_filtering_text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!