Coder Social home page Coder Social logo

pico-8.vim's Introduction

にほんご

PICO-8.vim

This is a Vim plugin package that adds support for PICO-8 cartridge files.

screenshot

(The nice colorscheme is from markbahnman/vim-pico8-color)

Installation

PICO-8.vim can be installed manually or using vim-plug: Plug 'bakudankun/pico-8.vim'

Features

  • Proper syntax highlighting for .p8 files as well as folding
  • Make vim visually imitate the PICO-8 console
  • Colorize graphics data

colorize demo

  • Keymaps to easily input symbols with Shift+[A-Z]
  • :Pico8Run command to run the current file in PICO-8

For details and configurations, see the help doc.

pico-8.vim's People

Contributors

bakudankun avatar leftbones 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  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pico-8.vim's Issues

changing colorscheme once file is loaded breaks graphics preview

when first opening up a .p8 file, the visualization of graphics data works as intended:
image

However, if I run alter the colorshceme (whether if be manually or as an autocommand) by running :colorscheme pico8 this graphics preview breaks:
image

So far I've been able to repoduce this only by changing vim's color scheme after a file has been loaded (even if I set it to the same colorscheme that's currently active).

I'm using neovim (v0.8.0), but I can confirm that the same happens when using vim.

Update README with little note

Think it would be helpful to mention that highlighting only works if you use a .p8 file extension and have the followling lines at the top of each file:

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

It would save idiots like me a few minutes of figuring it out 😄.

Only reason why I had the issue is because I use #include somefile.luas so I can edit easily with an external editor. All you need to do to get it working is change your .luas to .p8s and add that header to each file and then just #include your_module.p8.

Set working directory when calling pico8 -run

Hello and thanks for this package!

My projects are in sub-sub-directories of the pico-8 carts location, or in other directories entirely.
I usually run !pico8 -run % which works as pico-8 interprets the relative path correctly (I have autochangedir note), it does not try to load the filename from its carts directory. With :Pico8Run I get loading errors.
I think the current working directory should be set for the pico-8 process, or the absolute file path should be passed.

Add options

Options for the plugin itself:

  • indent mode (1 space, 2 spaces, 1 tab)
  • split mode for terminal output (split, vsplit, new buffer)

Options for running PICO-8: a string to specify options (useful for width/height, -i/-o, etc)

 function! pico8#run(mods, options) abort
   let cmdline = '"' . pico8#get_config('pico8_path', 'pico8') . '" -run ' . expand('%:p:S')
+  let cmdline = cmdline .. ' ' .. pico8#get_config('pico8_options', '')

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.