Skip to content

PICO 8 syntax highlighting in Sublime Text

Matt Jernigan edited this page Mar 25, 2017 · 2 revisions

The Lua syntax highlighter in Sublime Text works just fine for PICO-8 Lua.

Yet, there is also a PICO-8 flavor of the Lua highlighter in Neko250's PICO-8 package, which I find useful. This was originally created by Overkill for Sublime Text 2 and is found here.

If, like me, however, you don't want all the GUI overrides and other quirks of the PICO-8 package (which default on and are a pain to find to turn off, or worse, override), here is where Neko250 keeps the language file if all you want is the syntax highlighting (skipping the package install):

https://github.com/Neko250/sublime-PICO-8/blob/master/PICO-8.tmLanguage

  1. Download it. (It should work for both Sublime Text 2 and 3.)

  2. In Sublime, go into: Preferences > Browse Packages...

  3. Click into the User folder. Put it there (for ST3, at least).

  4. Set your *.p8 files to always open as PICO-8:

    • View > Syntax > Open all with current extension as > PICO-8

Hint: Now is also when you might want to go into Preferences > Settings - Syntax Specific, and set the other things I mentioned in the README.

Fixes

If you want to fix the escape sequence highlighting (if it is not fixed yet) edit PICO-8.tmLanguage and replace this text:

<string>\\.</string>

With this text (adapted from the latest Lua highlighter):

<string>\\([abfnrtv\\"']|\r?\n|\n\r?|\d\d?\d?|[xX][0-9a-fA-F]{2})</string>

Replace both occurrences in PICO-8.tmLanguage.

Clone this wiki locally