Giter VIP home page Giter VIP logo

sublime-pico-8's Introduction

Sublime PICO-8

PICO-8 plugin for the Sublime Text 3 editor.

sublime-PICO-8

This 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 official PICO-8 API.
  • Code snippets.

Installation

  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.

Using Git

Linux

cd ~/.config/sublime-text-3/Packages
rm -rf PICO-8
git clone https://github.com/Neko250/sublime-PICO-8 PICO-8

OSX

cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages
rm -rf PICO-8
git clone https://github.com/Neko250/sublime-PICO-8 PICO-8

Windows

cd "%APPDATA%\Sublime Text 3\Packages"
rd /s /q PICO-8
git clone https://github.com/Neko250/sublime-PICO-8 PICO-8

Manual Installation

  1. Download the files using the GitHub .zip download option.
  2. Unzip the files and rename the folder to PICO-8.
  3. Find your Packages directory:
    • Linux: ~/.config/sublime-text-3/Packages
    • Mac OS: ~/Library/Application Support/Sublime Text 3/Packages
    • Windows: %APPDATA%\Sublime Text 3\Packages
  4. Copy the folder into your Sublime Text Packages directory.

Post Installation

Font Setup

Independently of the installation method you chose, after installing you'll need to setup the PICO-8 font.

  1. Open the command palette with ctrl+shift+p (cmd+shift+p in OSX).
  2. Run PICO-8: Download Font command.
  3. Find PICO-8.ttf in your downloads folder and install it.
  4. Restart Sublime Text.

Test different font sizes until you find one that goes well with your screen resolution !

Cartridge Runner Setup

To setup the Cartridge Runner, open the Command Palette in Sublime Text (ctrl+shift+p / cmd+shift+p) and run "PICO-8: Setup PICO-8 Path". Then enter the path to PICO-8 in the prompt input.

  1. Open the command palette with ctrl+shift+p (cmd+shift+p in OSX).
  2. Run PICO-8: Setup PICO-8 Path command.
  3. Type the path to your PICO-8 executable. Defaults to:
    • Linux: /there/is/no/default/in/linux/shrug/pico8
    • OSX: /Applications/PICO-8.app/Contents/MacOS/pico8
    • Windows: C:\\Program Files (x86)\\PICO-8\\pico8.exe

IMPORTANT: Remember using the escape character for the backslash (\\) instead of a single one (\) in Windows !!!


Version History

  • v2017.3.14:

    • added: automatically lowercase the file upon saving.
    • added: extcmd function (syntax and autocomplete).
    • added: raspberry pi / pocketchip gpio snippet.
    • added: forpairs block snippet.
    • added: repeat-until block snippet.
    • added: goto block snippet.
    • added: semantic comments inside block snippets.
    • changed: updated api autocompletions to match PICO-8 0.1.10.
    • changed: forin block snippet renamed to forall.
    • fixed: hex number highlighting when not preceded by space.
    • fixed: comment start definition (Toggle Comment from the Command Palette).
  • v2016.7.1:

    • added: .no-sublime-package.
    • changed: package is no longer compressed.
    • fixed: cartridge runner is now visible to sublime.
  • v2016.6.30:

    • added: command palette download font shortcut: PICO-8: Download Font.
    • added: command palette preferences: Preferences: PICO-8 - Default & Preferences: PICO-8 - User.
    • added: command palette bbs shortcut: PICO-8: Browse BBS.
    • added: command palette API reference shortcut: PICO-8: Browse API Reference.
    • added: highlight_line setting defaults to true.
    • added: menu items to open preferences files: Preferences > Package Settings > PICO-8.
    • 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: PICO-8: Setup PICO-8 Path.
    • fixed: run cartridges from the command palette: PICO-8: Run Cartridge.
    • removed: old build system: PICO-8.sublime-build.
  • v0.1.8:

    • added: snippet library.
    • added: code completion.
    • changed: changed version to match PICO-8.
    • fixed: completed .tmLanguage functions.
  • v0.0.3:

    • removed: .no-sublime-package.
  • v0.0.2:

    • added: build system.
    • changed: installation message.
    • changed: font size no longer predefined.
    • changed: caret width no longer predefined.
  • v0.0.1:

    • added: installation message.
  • v0.0.0:

    • added: .p8 language definition.
    • added: syntax highlighting.
    • added: PICO-8 TrueType font.

sublime-pico-8's People

Contributors

abowerman avatar hsandt avatar khn190 avatar wh0am1-dev avatar xavier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sublime-pico-8's Issues

Feature request: Button glyphs

PICO-8 now supports/added Button Glyps since v0.1.7. It would be nice to also have these in the sublime plugin :)

Thanks in advance ๐Ÿ‘

Fix for escape character matching

The current language file uses this for matching escape sequences:

<string>\\.</string>

If you turn off the PICO-8 theme, you will see that decimal and hex escape sequences aren't fully colorized. This fixes it (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.

Uppercase letters.

Hello!

I used Sublimetext 3 and your Pico-8 plugin during GlobalGameJam 2017. It's a very nice plugin.

At one moment my game behaved strangely on code inspired by tutorials. Code that worked if I copy pasted it directly into my game. Strange!

After an hour spent slamming my head on my keyboard, I found the culprit: uppercase letters that look the exact same as lowercase later when using the plugin.

uppercase

Now I often CTRL-K CTRL-L my code to lowercase everything, but do you think anything could be done to prevent that? When coding directly in Pico-8, symbols are written instead of uppercase letter.

auto indent not working as intended

type: "function whatever()"
type contents of function
press enter
type "end"
... end is indented.

Expected behaviour: end reindents back to match its opening function operator

This is true for edit > line > reindent which just basically ignores all indentation and flatlines everything to column 1.

Indentation is fixed to 1 space in all snippets

All snippets used fixed indents of 1. This is common in PICO-8 (to reduce character count), but some programmers may prefer indentations of 2 or 4 spaces (esp. if using Lua minifier like me, so they don't care about character count at first).

Sublime Text doc recommended to always insert an actual tab as indent in snippets. The tab would then be expanded to a tab, or spaces with the right amount, depending on the file's current settings.

So, I suggest replacing all 1-space indents with tabs. Programmers used to 1-space indents will still be able to insert them, provided their file is set to Indent: 1 space. While others will be able to indent with whatever they prefer.

Ex:

<snippet>
	<content><![CDATA[
function ${1:foo}(${2:var})
 ${3:-- do something}
end
]]></content>
	<tabTrigger>func</tabTrigger>
	<scope>source.p8</scope>
	<description>function</description>
</snippet>

would become

<snippet>
	<content><![CDATA[
function ${1:foo}(${2:var})
	${3:-- do something}
end
]]></content>
	<tabTrigger>func</tabTrigger>
	<scope>source.p8</scope>
	<description>function</description>
</snippet>

The invisible space before ${3 above is an actual tab.

Disable auto-lowercase feature

I uninstalled this package today because of the new auto-lowercase feature. Is there another way to disable this without uninstalling?

I keep programming notes in p8 files and I prefer to keep those notes in mixed case. I also have plans to create my own font in games, which requires case preservation. (Obviously, I don't use the PICO-8 font in programming... even though I offer a bitmapped one that functions well with the extended characters here: https://github.com/juanitogan/p8-programming-fonts .)

No such file or directory: 'pico8'

Hi, @neko250 .

First of all, thank you for this project. There's a lot of Sublime Text users out there and I think it'll be very useful.

I'm not a Sublime Text so I don't know if I'm missing something. I installed ST3 here to test your package and followed your instructions for the OS X but I could't get it to work. It keeps saying [Errno 2] No such file or directory: 'pico8'

Here's some screenshots:

screen shot 2016-06-28 at 16 42 04

screen shot 2016-06-28 at 16 41 58

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.