-
Notifications
You must be signed in to change notification settings - Fork 3
Using Sublime Text and Auto Fold with PICO 8 files
Matt Jernigan edited this page Mar 22, 2017
·
3 revisions
Auto Fold is a Sublime Text package that can be used to automatically code fold the header and tail data of your *.p8 files to get them out of your way while working on your code. To do this:
- Use Package Control (assuming you've installed Package Control) to search for and install Auto Fold.
- Use the "Package Control:List Packages" command to open a list of your installed packages.
- Click on the Auto Fold package to open File Explorer to the package location.
- Open
Auto Fold.sublime-package
as if it were a ZIP archive (it is) with something like 7-Zip. (Or, follow the package instructions to find the following file on GitHub.) - Copy the
AutoFold.sublime-settings
file from the archive to thePackages\User
folder in this same part of the tree. (For me this is:C:\Users\xxxx\AppData\Roaming\Sublime Text 3\Packages\User
) - Edit and save that settings file to contain the lines I've added for PICO-8 (lines 16, 17, and 26 -- and don't forget to add commas to lines 15 and 25) as seen here:
{
"attributes" : [ // attributes to auto-fold
"href",
"src"
],
"tags": [ // tags auto-fold
"h1"
],
// "\\{(.|\n)*?\\}" // note: multiline regexps should include \n.
// "." does not mach new lines
"regexps": [ // regexps to auto-fold
"(?<=(url)\\().*?(?=\\))", // fold urls in css files
"(?<=\\()http.*?(?=\\))", // fold markdown urls "(http://..)"
"^pico(.*\n)*__lua__$", // PICO-8 header
"^__gfx__(.*\n)*" // PICO-8 data block
],
"extensions": [ // activate this plugin for file extensions:
"html",
"htm",
"css",
"xml",
"md",
"p8"
],
"runOnLoad": true, // auto-fold on load
"runOnSave": true // auto-fold on save
}