Log In  

Hello, world !

I've made a Sublime Text package to support and speed up PICO-8 development.

The package includes:

  • .p8 language definition (by Overkill).
  • Syntax highlighting (by Overkill).
  • PICO-8 .ttf font (by RhythmLynx).
  • Cartridge runner to launch your cart right from Sublime Text.
  • Code completion based on the PICO-8 API.
  • Code snippets.

If you have Package Control installed, just follow this instructions to get it:

  1. Open the command palette with "ctrl+shift+p" ("cmd+shift+p" in OSX).
  2. Run "Package Control: Install Package" command.
  3. Search for "PICO-8" and install it.
  4. Restart Sublime Text (if required).

Click here to see further installation instructions !

I will try to keep the package up to date along with the API CheatSheet and PICO-8.
If you installed it using Package Control, it'll update automagically !

Have fun.

P#23772 2016-06-27 21:58 ( Edited 2018-06-19 12:21)

1

I love that it uses both the font and the colors. Very cool.

Now I want a C64 Sublime package with similar features... hmm...

P#23773 2016-06-27 22:40 ( Edited 2016-06-28 02:40)

I noticed lineHighlight was identical to background in PICO-8.tmTheme. I made a local change (bumped RGB each up 16):

<key>lineHighlight</key>
<string>#6F675F</string>

and added to Syntax Specific - User settings:

{
"highlight_line": true,
}

to enable line highlighting. A slight divergence from the built-in editor but it makes up for an inability to match Pico-8's block cursor, which otherwise leaves the cursor difficult to see with these colors. (I tried several caret_style settings. If I missed something that would enable a more visible cursor I'd be interested to know.)

P#23776 2016-06-28 02:23 ( Edited 2016-06-28 06:23)

This is awesome! Reindenting lines does not work for me. Am I doing something wrong or is this just not implemented? I use reindenting all the time.

P#23778 2016-06-28 03:24 ( Edited 2016-06-28 07:24)

@Tilman it's a problem in the language definition that has so far evaded a solution

P#23792 2016-06-28 16:16 ( Edited 2016-06-28 20:16)

Really cool, thanks to the authors.

For 1.8 we need glyphs for the buttons. It looks like they're mapped to some unicode character, so the font just needs to supply characters for those codes. Also if we could get shift+udlrxo or alternative shortcuts to insert them in sublime too that would be great.

A token counter would be amazing for the LUA portion of the file. I'm not sure how feasible that is though.

P#23794 2016-06-28 16:46 ( Edited 2016-06-28 20:46)

New update !!!

v2016.6.30 changelog:

- added: command palette download font shortcut.
- added: command palette preferences.
- added: command palette bbs shortcut.
- added: command palette API reference shortcut.
- added: "highlight_line" setting defaults to true.
- added: menu items to open preferences files.
- changed: version system changed to tagging date.
- changed: theme's line highlight is now a bit brighter than the background.
- fixed: setup cartridge runner from the command palette.
- fixed: run cartridges from the command palette.
- removed: old build system.
P#24011 2016-06-30 17:18 ( Edited 2016-06-30 21:18)

/me scoffs at the non-purists

;)

/me remembers not having done anything meaningful with PICO-8

:(

/me investigates Sublime

P#24012 2016-06-30 17:44 ( Edited 2016-06-30 21:44)

One question - is it necessary to download the font, i.e. is it a dependency? Because I've never enjoyed the PICO-8 font, and would rather not use it if in SublimeText

P#30065 2016-10-05 11:20 ( Edited 2016-10-05 15:20)

I'm having difficulty finding any links for the files you mentioned, even after going to: https://packagecontrol.io/packages/PICO-8

Could you please post a reply with all URL link downloads to this unique PICO editor.

Thanks !

P#30082 2016-10-05 17:33 ( Edited 2016-10-05 21:33)

@ibisum:
In Sublime Text, navigate to "Preferences > Package Settings > PICO-8 > Settings - User" or just open the command palette ("ctrl+shift+p" / "cmd+shift+p"), type "Preferences: PICO-8 - User" and add this line to the json:

"font_face": "<Comic Sans>"

Just remember to replace "<Comic Sans>" with your desired font !
Of course, you can customise other Sublime Text settings for the language definition in the same json.

@dw817:
You only need to download the PICO-8.ttf by @RhythmLynx.
Here is the download link.

P#30089 2016-10-05 19:22 ( Edited 2016-10-05 23:22)

I've downloaded the font and the SUBLIME text editor. Thanks.

Don't I need something more than just the download of SUBLIME ? - like something to highlight commands specifically for PICO ?

And - how do I put the PICO font into the editor ?

P#30090 2016-10-05 19:38 ( Edited 2016-10-05 23:38)

@dw817:
Of course, you have to install PackageControl package manager first.
Here is the installation guide link.
The rest of the sublime-PICO-8 package installation is explained here.

About the font: with the sublime-PICO-8 package installed, Sublime automatically uses the PICO-8 font to render .p8 files if it is installed globally on your OS. Actually, what's happening in the background ? There's a Sublime preferences file unique to the sublime-PICO-8 package, and inside of it (it's a json file), there's a line like this:

"font_face": "PICO-8"

You can override it by writting the same line with a different font declaration inside the package user preferences file, accesible the way I've already told to @ibisum in the last post.

Hope it helps !
[0x0]

P#30181 2016-10-07 06:09 ( Edited 2016-10-07 10:09)

Neko. I appreciate your help. One thing you'll find about me is I always write packages that are ready-to-run right out of the box.

You could possible say - oh, I don't know - maybe ZIP up all the elements needed for this new editor of yours in one big download so you don't have to download pieces of it from multiple sites.

Yeah, I think it's a good idea too. :)

P#30187 2016-10-07 09:41 ( Edited 2016-10-07 13:42)

There are fans and there are fanatics. I'm not a fanatic. While I appreciate the work done on this package, forgive me if I also offer some, hopefully, constructive criticism... and/or help to others like me.

One of the primary reasons for using a code editor such as Sublime is to bring some consistency to all languages and tools I work with. Therefor, to override that consistency kills one of the primary reasons for using Sublime. I have no need to punish myself with fonts and palettes like PICO-8's. (Even if I wanted to program in a 3x5 font, it would be Terminal 3pt and not Pico's horrible version -- I mean, ugh, that B is the worst rendition ever -- try writing DUMB and not reading it as DUNE. I will grant that Pico's N is better than Terminal's. Anyway....)

Thus, while I appreciate parts of this package, I do not appreciate that it overrides my font, color, tab, line padding, and line highlight settings (really?! forced line highlight? define the color but don't set the option). I wasted perhaps an hour or more finding the best way to reverse all this back to normal while not just simply uninstalling the package. [Try finding the default Sublime font if you don't happen to already know it. You can't find it in the Sublime prefs, you have to Google it.] Furthermore, you can't just revert to your own default Sublime settings if you follow the recommendation above to revert things by editing PICO-8 > Settings - User. That was a total waste of time. If you go that route then you have to come back here whenever you decide to change something that might be overridden here. Sometimes you may want that, but doubtful. No, expected behavior is far more achievable by going to PICO-8 > Settings - Default and whacking out most or all of the lines. Then you don't have to worry about storing personal settings in two places. Personal global settings stored in one place is ideal, right?

So, in other words, if someone wants to release a PICO-8 package without the default visual overrides, I would support it. If you then want to include an optional color scheme in that, fine. That's cool. If you want to also include instructions for setting the editor font for P8 files, that's also cool. I would find such a package much more helpful than this one.

Speaking of color schemes and such, you are missing Pico's alternate version with the dark blue background. See Pico's config.txt.

Also, another optional hint is to set "rulers": [32] in PICO-8 > Settings - User. Note that if you then set the ruler through the menu system, you can't get this setting back until you close and re-open the file.

Another curiosity is that "no_antialias" doesn't seem to work on Windows (I believe you have to dig into Windows text settings to achieve this). So the replica text is close but not exact (but not a bother to me since I don't use it). UPDATE: the answer to this is to set both "gdi" and "no_antialias".

Some instruction on how to hook up Build (Ctrl+B) to launch the cartridge would also be helpful.

I apologize if this sounds too critical. I do appreciate and thank you for the work on this.

Matt

P#31263 2016-10-19 20:19 ( Edited 2017-03-17 02:46)

Here's another thing than can be done to make the Sublime experience better with pico. Install the Auto Fold package to code fold the header and tail data. To do this:

  1. Use Package Control (assuming you've installed Package Control) to search for and install Auto Fold.
  2. Use the Package Control:List Packages command to open a list of your installed packages.
  3. Click on the Auto Fold package to open File Explorer to the package location.
  4. 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.)
  5. Copy the AutoFold.sublime-settings file from the archive to the Packages\User folder in this same part of the tree. (For me this is: C:\Users\xxxx\AppData\Roaming\Sublime Text 3\Packages\User)
  6. Edit and save that settings file to contain the lines I've added for pico (lines 16, 17, 26 -- 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
}
  1. Note that the Auto Fold package currently has a bug that causes it to not load until one of its triggering file types is opened after the initial startup of Sublime. That is, if you open Sublime with a P8 file already opened, it won't fold the code, not even on save. You need to either close the p8 and reopen it, or open another p8, html, or other supported file to trigger loading the package. Then the first p8 should fold on save. Thus, maybe keep a dummy html file nearby to workaround this. A bit of a pain but this package still looked more like what I wanted versus the other folding packages.
    7.a. UPDATE: Auto Fold has been fixed to fold on most events including Sublime startup.

It might be worth considering borrowing (and fixing) the code from Auto Fold to include in this PICO-8 package.

P#31342 2016-10-20 17:42 ( Edited 2017-03-16 23:16)

Hi, I got the package and it seems to be working well except for the cart runner, I don't know if I set it up correctly or how to use it. I tried following from here https://packagecontrol.io/packages/PICO-8 hitting ctrl+shift+p entering PICO-8: Setup PICO-8 Path and I still get No Build System

and in both the default and user settings for the package I have the line

"pico-8_path": "C:\\Program Files (x86)\\PICO-8\\pico8.exe",

not sure what I'm supposed to do to be able to run carts from sublime 3.

P#41267 2017-06-03 12:17 ( Edited 2017-06-03 16:17)

The plugin doesn't use the Sublime Text build system, JordanKlooster ! D:
Open the command palette (ctrl+shift+p) and search for "PICO-8: Run Cartridge".

P#41296 2017-06-04 20:26 ( Edited 2017-06-05 00:26)

Thanks so much Neko

P#41313 2017-06-05 16:41 ( Edited 2017-06-05 20:41)

Instead of changing the font size globally using Ctrl+= and Ctrl+Shift+=, I added

"font_size": 11

to the PICO-8 package settings and now the Pico-8 font stays fixed at its ideal scaling size while my normal font size elsewhere is a little smaller.

P#41375 2017-06-08 00:35 ( Edited 2017-06-08 04:36)

This is brilliant - only complaint is that the predictive text forces elseifs when typing if-else statements, the lack of linter and the lack of reindentation.

Any idea for workarounds on these 3 issues?

Brilliant packages btw - i'm sure it got a lot more people involved in pico8 development.

P#44461 2017-09-22 18:28 ( Edited 2017-09-22 22:28)

Hey, thanks !
Still, I can't run cartridges from sublime text, even with "PICO-8: Run Cartridge".
PICO launches, and says he could not load it.
Do you have an idea ?

P#53653 2018-06-19 08:21 ( Edited 2018-06-19 12:21)

I cannot get the run cartridge from sublime to work. I've done everything else and when I click the run cartridge nothing happens

P#68315 2019-10-01 17:22

This is interesting.

It makes me wonder if ZEP will if not allow for runtime to exceed 128x128 pixels, at least to have the editor optionally exceed this resolution for source-code editing and have and view lines longer than 32-characters.

P#68338 2019-10-02 00:54 ( Edited 2019-10-02 00:55)

Hoping someone can help.

I'm pressing CTRL+SHIFT+P and "PICO8:-Run Cartridge", pico8 opens but says "could not load" then the filename and path. I've saved source file as .p8 and saved it to a local drive.

Thanks in advance

P#71458 2019-12-28 13:28

I'm just now seeing a problem, may not affect anyone but me. When you RUN any cart, doesn't it bring up the P8 logo and audio riff each time ? Is there a way to bypass this ?

P#71483 2019-12-29 02:37 ( Edited 2019-12-29 02:38)

@dw817 I can't get carts running says could not load any tips?

P#71815 2020-01-07 15:30

You're asking a guy with a problem about another problem who can't solve your problem because his problem can't answer your problem until his problem is no longer a problem.

I think we have a problem ...

P#71823 2020-01-07 20:02 ( Edited 2020-01-07 20:03)

I too, am having issues running setting up cart runner. Looking for solutions!

P#74498 2020-04-06 01:17

Fixed some of the sublime - pico loading problems
I had issues to running a pico card from sublime, too. Here are some things I have figured out to make it work for me. Hope it helps.

I had to save the *.p8 file I wrote in sublime in exact the same location the pico demo folder is. For me this is:
C:\Users\User\AppData\Roaming\pico-8\carts\NameOfMyNewFile.p8
Note, the ending .p8 is importend.

Also, I figured out I have to inclued these folloing 3 lines as my first lines in the sublime written pico file: (dont worry, it doesnt count to the token count in pico)

pico-8 cartridge // http://www.pico-8.com
version 30
lua

here I can begin to write my game and the run cartridge function works.
(the format kills the underscores around the lua in the third line. There are two underscores in front of the lua and another two underscores behind. Try to make a picture of the three lines for you)

P#88305 2021-02-28 19:21 ( Edited 2021-02-28 19:27)

Hello all, I'm new here. Is there an easy way to just have Sublime Text 3 run the cartridge, without changing font or colors or with any kind of autocomplete etc, literally just like you're viewing any text doc in Sublime - but hitting a certain key launches the cart in Pico-8?

Awesome as it looks, I don't really need that stuff. POSSIBLY just the colors but can figure that out separately.

Thanks for any help.

P#96026 2021-08-14 22:22

Hi, newbie here to both coding and PICO-8 (and Sublime).

Is there a way to bind a keyboard shortcut to the "PICO-8: Run Cartridge" command?

Thanks

P#117539 2022-09-16 18:27 ( Edited 2022-09-16 18:31)

What Diablothe2nd said! I tried looking at key binding, but failed to work out how to reference the command "Run Cartridge"

P#117819 2022-09-22 20:28

did a quick web search and it seems that sublime text does not support configuring custom shortcuts! weird

P#117820 2022-09-22 20:58

I've been trying out Sublime again and I feel like, if I'm using the PICO-8 font to edit .p8 files, it should probably mimic the uppercase/lowercase reversal that PICO-8 has.

The original download links for @RhythmLynx's custom PICO-8 fonts are dead, so I tracked down an archived version of the alternate font with upper/lower swapped, and I'm posting it here in case anyone else wants to use it:

PICO-8_mono_reversed.ttf

You'll need to set this in Sublime by clicking the menu option Preferences → Settings - Syntax Specific and editing the user settings in PICO-8.sublime-settings to look something like mine, notably the font_face line:

// These settings override both User and Default settings for the PICO-8 syntax
{
    // my personal preference inside PICO-8
    "tab_size": 2,

    // I have visible tabs; I can wrangle them myself
    "translate_tabs_to_spaces": false,

    // swao upper and lower to match PICO-8
    "font_face": "PICO-8 mono reversed",

    // on my system, this makes gaps between lines one "pixel" tall, but YMMV with DPI
    "line_padding_bottom": 3,
    "line_padding_top": 3,

    // I don't think having this true by default was a good idea
    "pico-8_auto_lowercase": false
}
P#138081 2023-12-01 11:30 ( Edited 2023-12-01 11:40)

Ok, I'm really new/stupid here, but I've been using Sublime with the PICO-8 package for a while, and recently have had an issue not wanting to auto lowercase on save. I found this page talking about it, with a solution:

https://github.com/wh0am1-dev/sublime-PICO-8/issues/8

And I see @Felice has the same line in settings. However, when I put that line in PICO-8.sublime-settings (either/both Default and User), it seems to have no effect. What am I doing wrong?

P#138156 2023-12-02 18:16

Oof, yeah same issues, can do anything BUT run the cart.

P#141293 2024-02-08 17:47

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 11:39:33 | 0.037s | Q:73