Skip to content

Simple Sublime Text 2 command to output the results of running the current file to a Sublime buffer, instead of the console.

Notifications You must be signed in to change notification settings

mthurlin/RunInScratch

Repository files navigation

Run in Scratch

A simple plugin to run the current buffer, and output its results to another view in Sublime Text 2, instead of the console. The results view will be associated with the original buffer, so any subsequent running of Run in Scratch will output to this view. The first time it is run, a new view is created on the right in column mode (currently it assumes you are working with one view per window).

example

Why?

I'm surprised not to have found something like this already out there, which leads me to think that I may be alone in my dislike of results of scripts being displayed in the console, so here are my reasons:

  • Same colour scheme as the rest of the program.
  • It seems more efficient to have the results to the side of the script, as the shape of monitors generally means there is more space available for another view column than there is for another view row.
  • I prefer being able to detach the results view and move it to a different monitor.

Notes

The command will check what syntax the current buffer is, and run a command on the command line based on this (but see note below). Currently the only syntaxes associated with any commands are:

  • Ruby
  • Python
  • Applescript

These are all run without arguments. To add arguments or use any other interpreter, add a shebang line to the top of the file.

Before running the file, the command will cd into its base directory.

About

Simple Sublime Text 2 command to output the results of running the current file to a Sublime buffer, instead of the console.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages