Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Execute selected text as python or perl' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Execute selected text as python or perl
Authored by: neror on Mar 11, '05 02:29:11PM
TextMate can do this for you with Ctrl-R. For example select the text:

ruby -e "print \"\nHello TextMate\n\""

and hit Ctrl-R and you end up with this:

ruby -e "print \"\nHello\n\""
Hello TextMate


I haven't found it super useful yet, but it does what you're talking about without any cutting and pasting. It actually executes the selected test in it's own shell environment, and you can set environment variables and everything. Pretty cool.

I'm not affiliated, but TextMate is available at macromates.com. It costs about $40, but it has a 30 day trial.

[ Reply to This | # ]