Skip to content

Instantly share code, notes, and snippets.

@typoman
Created December 14, 2018 16:40
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typoman/1180765bc0ef06432d4640f41604acc9 to your computer and use it in GitHub Desktop.
Save typoman/1180765bc0ef06432d4640f41604acc9 to your computer and use it in GitHub Desktop.
{
"cmd": ["robofont", "-p", "$file"],
"file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
"selector": "source.python",
}
@typoman
Copy link
Author

typoman commented Dec 14, 2018

Robofont build system for Sublime Text

Do you dislike the script editor inside Robofont? Ever wanted to run python scripts from sublime and make them executed inside Robofont? Download this file and put it inside the following folder:

Library/Application Support/Sublime Text 3/Packages/User

Before you use the Build system make sure you have installed Robofont as shell command by going to Robofont Preferences > Extensions > Shell and click on the install button. To make sure that it's installed correctly write robofont in the terminal and hit return. For Robofont shell command to work correctly you probably need to install PyObjC in terminal using pip3.

Now if you choose Robofont from Tools > Build System inside sublime, after you run the script using <Cmd+b>, the code will execute inside the RF. Smooth!

@thundernixon
Copy link

Small but important final step: you must save the scripts you make in Sublime before you try to run them.

Otherwise, you will probably get something like the following error:

Traceback (most recent call last):
  File "/usr/local/bin/robofont", line 37, in <module>
    elif arg[0] == '-':
IndexError: string index out of range
[Finished in 0.4s with exit code 1]
[cmd: ['robofont', '-p', '']]
[dir: /Applications/Sublime Text.app/Contents/MacOS]
[path: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/opt/X11/bin]

@thundernixon
Copy link

@typoman this is awesome, by the way!

Do you happen to know if there's a way to get robofont's output (e.g. from print() statements) in the Sublime output panel?

@typoman
Copy link
Author

typoman commented Apr 17, 2019

You're welcome Stephan. For the output thingy you can upvote the feature request here:

https://forum.robofont.com/topic/623/robofont-shell-output-also-inside-shell

@RafalBuchner
Copy link

Damn it! I have to make the same for the Atom, awesome!

@ddaanniiieeelll
Copy link

I would very much appreciate this for Atom. It would make me very happy if you could do this @RafalBuchner :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment