Using Sublime Text with LilyPond on Mac OS X

Way back in 2009 I wrote up some instructions on how to use LilyPond with jEdit on Mac OS X. I never much attached myself to jEdit, but it was serviceable for LilyPond at least. Today however I use Sublime Text for just about all my coding, and it makes a perfectly fine replacement for the LilyPond app’s built-in editor, with a bit of configuration. Here’s how I have mine set up:

  1. Install SubLilyPond into Sublime Text via Package Control

  2. Add a build system to Sublime Text (Tools → Build System → New Build System…) based on these nice instructions. Specifically, I named my file lilypond.sublime-build and it had this code in it, which specifies the exact path to the Mac LilyPond binary in my Applications directory:

Now .ly files will get syntax highlighting in Sublime Text, and the F7 or ⌘+B keystroke will build my PDF file. I then keep the working PDF loaded in Google Chrome (which has a built-in PDF viewer), and just hit refresh on that window every time I want to view the results of the build.