How to send selected text (or string) to TextMate on R running on terminal

I just started using R on the terminal because its tab. But I do not know how to send the selected text in TextMate to the terminal. Can an expert show me how to write a command in TextMate?

Thanks!

+6
source share
2 answers

Here is the exact TextMate command I'm using right now. Hope this 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" & 

enter image description here

+8
source

TextMate is MacOS, right? So, then this comes from the R ?connections page:

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

You can "paste" from R-Clipboard into terminal sessions. You can also send the contents of the file from TextMate: http://manual.macromates.com/en/shell_commands#executing_commands_filtering_text

+1
source

Source: https://habr.com/ru/post/908075/


All Articles