Skip to content

Instantly share code, notes, and snippets.

@Bananattack
Last active February 5, 2021 19:36
Show Gist options
  • Save Bananattack/e602ac4b796e5f529d96 to your computer and use it in GitHub Desktop.
Save Bananattack/e602ac4b796e5f529d96 to your computer and use it in GitHub Desktop.
PICO-8 syntax highlighting and theme in Sublime Text 2.

PICO-8 in Sublime Text 2

Syntax Highlighting

  1. Open up your Packages folder by going Preferences >> Browse Packages...
  2. Create a new folder named "Pico8"
  3. Save the Pico8.tmLanguage file there.

Color Scheme

  1. Open up your Packages folder by going Preferences >> Browse Packages...
  2. Create a new folder named "Color Scheme - Pico8"
  3. Save the Pico8.tmThere file there.

Editor Settings

Note that the setting file uses an unofficial PICO-8 font from RhythmLynx posted in this thread http://www.lexaloffle.com/bbs/?tid=3109 -- download and install that first!

  1. Open up your Packages folder by going Preferences >> Browse Packages...
  2. Open up the folder "User"
  3. Save the Pico8.sublime-settings file there.

You're done!

Screenshot

Notes

There may be some colors and stuff that aren't 100% accurate to pico8 itself, I mainly just worked off some existing theme and language files. Since I just copy-pasted those files and made revisions, I probably didn't even package them properly -- I see UUIDs and stuff in there that I didn't bother to change. Anyway! It seems to work and I didn't want to spend all day, so good enough.

{
"tab_size": 1,
"translate_tabs_to_spaces": true,
"detect_indentation": false,
"font_size": 7.5,
"font_face": "PICO-8",
"font_options": ["no_antialias"],
"line_padding_bottom": 1,
"line_padding_top": 1,
"color_scheme": "Packages/Color Scheme - Pico8/Pico8.tmTheme"
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>PICO-8 (derived from Lua Syntax: version 0.8)</string>
<key>fileTypes</key>
<array>
<string>p8</string>
</array>
<key>foldingStartMarker</key>
<string>^\s*\b(function|local\s+function|if|for)\b|{[ \t]*$|\[\[</string>
<key>foldingStopMarker</key>
<string>\bend\b|^\s*}|\]\]</string>
<key>keyEquivalent</key>
<string>^~L</string>
<key>name</key>
<string>Lua</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.control.lua</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.function.scope.lua</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>entity.name.function.lua</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.parameters.begin.lua</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>variable.parameter.function.lua</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>punctuation.definition.parameters.end.lua</string>
</dict>
</dict>
<key>match</key>
<string>\b(function)\s+([a-zA-Z_.:]+[.:])?([a-zA-Z_]\w*)\s*(\()([^)]*)(\))</string>
<key>name</key>
<string>meta.function.lua</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;![\d.])\s0x[a-fA-F\d]+|\b\d+(\.\d+)?([eE]-?\d+)?|\.\d+([eE]-?\d+)?</string>
<key>name</key>
<string>constant.numeric.lua</string>
</dict>
<dict>
<key>begin</key>
<string>'</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.lua</string>
</dict>
</dict>
<key>end</key>
<string>'</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.lua</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.lua</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.lua</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.lua</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.lua</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.lua</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.lua</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(?&lt;!--)\[(=*)\[</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.lua</string>
</dict>
</dict>
<key>end</key>
<string>\]\1\]</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.lua</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.other.multiline.lua</string>
</dict>
<dict>
<key>begin</key>
<string>--\[(=*)\[</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.lua</string>
</dict>
</dict>
<key>end</key>
<string>\]\1\]</string>
<key>name</key>
<string>comment.block.lua</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.lua</string>
</dict>
</dict>
<key>match</key>
<string>(--)(?!\[\[).*$\n?</string>
<key>name</key>
<string>comment.line.double-dash.lua</string>
</dict>
<dict>
<key>match</key>
<string>\b(break|do|else|for|if|elseif|return|then|repeat|while|until|end|function|local|in|goto)\b</string>
<key>name</key>
<string>keyword.control.lua</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;![^.]\.|:)\b(false|nil|true)\b</string>
<key>name</key>
<string>constant.language.lua</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;![^.]\.|:)\b(self)\b</string>
<key>name</key>
<string>variable.language.self.lua</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;![^.]\.|:)\b(load|save|folder|ls|run|resume|reboot|stat|info|flip|printh|_update|_draw|_init|clip|pget|pset|sget|sset|fget||fset|print|cursor|color|cls|camera|circ|circfill|line|rect|rectfill|pal|palt|spr|sspr|add|del|all|foreach|pairs|btn|btnp|sfx|music|mget|mset|map|peek|poke|memcpy|reload|cstore|memset|max|min|mid|flr|cos|sin|atan2|sqrt|abs|rnd|srand|band|bor|Bxor|bnot|shl|shr|sub|cartdata|dget|dset)\b</string>
<key>name</key>
<string>support.function.lua</string>
</dict>
<dict>
<key>match</key>
<string>\b(and|or|not)\b</string>
<key>name</key>
<string>keyword.operator.lua</string>
</dict>
<dict>
<key>match</key>
<string>\(|\)|\;|\+=?|-=?|%=?|#|\*=?|\/=?|\^=?|\[|\]|==?|~=|&lt;=?|&gt;=?|,|\.\.?\.?|(?&lt;!\.)\.{2}(?!\.)</string>
<key>name</key>
<string>keyword.operator.punctuation.lua</string>
</dict>
</array>
<key>scopeName</key>
<string>source.p8</string>
<key>uuid</key>
<string>93E017CC-6F27-11D9-90EB-000D93589AF7</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>PICO-8</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>
<string>#5F574f</string>
<key>caret</key>
<string>#FFf1e8</string>
<key>foreground</key>
<string>#C2c3c7</string>
<key>invisibles</key>
<string>#BFBFBF</string>
<key>lineHighlight</key>
<string>#7e2553</string>
<key>selection</key>
<string>#FFF024</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Source</string>
<key>scope</key>
<string>source</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#5F574f</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Comment</string>
<key>scope</key>
<string>comment</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#83769c</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Keyword</string>
<key>scope</key>
<string>keyword, storage</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FF77a8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Keyword operator</string>
<key>scope</key>
<string>keyword.operator.assignment</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FFf1e8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Keyword operator</string>
<key>scope</key>
<string>keyword.operator.punctuation</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FFf1e8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>keyword like new</string>
<key>scope</key>
<string>keyword.other.special-method</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FF77a8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Function (definition)</string>
<key>scope</key>
<string>entity.name.function, keyword.other.name-of-parameter.objc</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#C2c3c7</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Class (definition)</string>
<key>scope</key>
<string>entity.name</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#C2c3c7</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Number</string>
<key>scope</key>
<string>constant.numeric</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#29ADFF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Variable</string>
<key>scope</key>
<string>variable.language, variable.other</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#C2c3c7</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Built-in constant</string>
<key>scope</key>
<string>constant.language</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FF77a8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Variable</string>
<key>scope</key>
<string>variable.other.constant.ruby</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0F8787</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Built-in constant</string>
<key>scope</key>
<string>constant.language</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#29ADFF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>String</string>
<key>scope</key>
<string>string</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#29ADFF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Inherited class</string>
<key>scope</key>
<string>entity.other.inherited-class</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#0F87FF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Inherited class seperator</string>
<key>scope</key>
<string>punctuation.separator.inheritance</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#FFF1E8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>punctuation block</string>
<key>scope</key>
<string>punctuation.separator.variable</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#FFf1e8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>array brackets</string>
<key>scope</key>
<string>punctuation.section.array</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#FFF1E8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>hash separator</string>
<key>scope</key>
<string>punctuation.separator.key-value</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#FFF1E8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>() brackets</string>
<key>scope</key>
<string>punctuation.section.function, punctuation.definition.parameters</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#FFf1e8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>hash brackets</string>
<key>scope</key>
<string>punctuation.section.scope</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FFF1E8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Special ruby method</string>
<key>scope</key>
<string>keyword.other.special-method.ruby</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
</dict>
</dict>
<dict>
<key>name</key>
<string>symbol</string>
<key>scope</key>
<string>constant.other.symbol</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FF77a8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Support class</string>
<key>scope</key>
<string>support.class</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#00e756</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Support type</string>
<key>scope</key>
<string>support.type</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#00e756</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Support function</string>
<key>scope</key>
<string>support.function</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#00e756</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>String.regexp</string>
<key>scope</key>
<string>string.regexp</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#29ADFF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>String embedded source</string>
<key>scope</key>
<string>string.quoted source</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#29ADFF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>doctype punctation</string>
<key>scope</key>
<string>meta.tag.sgml.html</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#FFF1E8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>doctype declaration</string>
<key>scope</key>
<string>entity.name.tag.doctype</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#999999</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>doctype string</string>
<key>scope</key>
<string>string.quoted.double.doctype</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#29ADFF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>html tag punctuation</string>
<key>scope</key>
<string>punctuation.definition.tag</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FF77A8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>html tag punctuation</string>
<key>scope</key>
<string>entity.name.tag</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#FFf1e8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>html attribute</string>
<key>scope</key>
<string>entity.other.attribute-name</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#5577BB</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>html attribute punctation</string>
<key>scope</key>
<string>entity.other.attribute-name</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#7799CC</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>erb tags</string>
<key>scope</key>
<string>punctuation.section.embedded.ruby</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#999999</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>ruby string interpolation</string>
<key>scope</key>
<string>source.ruby.embedded.source punctuation.section.embedded.ruby</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#CF1040</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>css brackets</string>
<key>scope</key>
<string>punctuation.section.property-list.css</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
</dict>
</dict>
<dict>
<key>name</key>
<string>css property</string>
<key>scope</key>
<string>support.type.property-name.css</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#994488</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>css property punctuation</string>
<key>scope</key>
<string>punctuation.separator.key-value.css</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#555555</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>css property value</string>
<key>scope</key>
<string>meta.property-value, constant.other.color</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FF77a8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>css ending</string>
<key>scope</key>
<string>punctuation.terminator.rule.css</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#555555</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>css font</string>
<key>scope</key>
<string>support.constant.font-name</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FF77a8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>css keyword</string>
<key>scope</key>
<string>keyword.other.unit</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FF77a8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>pseudo class</string>
<key>scope</key>
<string>entity.other.attribute-name.pseudo-class</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#8855CC</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>css constant property value</string>
<key>scope</key>
<string>support.constant.property-value</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#8855CC</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>css attribute class</string>
<key>scope</key>
<string>entity.other.attribute-name.class</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#3366CC</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>css attribute id</string>
<key>scope</key>
<string>entity.other.attribute-name.id</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#990000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff header from</string>
<key>scope</key>
<string>meta.diff.header.from-file</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#FFDDDD</string>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#555555</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff header to</string>
<key>scope</key>
<string>meta.diff.header.to-file</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#DDFFDD</string>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#555555</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff inserted</string>
<key>scope</key>
<string>markup.inserted.diff</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#DDFFDD</string>
<key>fontStyle</key>
<string></string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff deleted</string>
<key>scope</key>
<string>markup.deleted.diff</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#FFDDDD</string>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#555555</string>
</dict>
</dict>
</array>
<key>uuid</key>
<string>26786979-843B-4FE2-BCB6-4FCEC6F8FB58</string>
</dict>
</plist>
@mgnauck
Copy link

mgnauck commented Nov 29, 2016

The 3rd point under 'Color Scheme' should read 'Save the Pico8.tmTheme file there.'.

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