Log In  

I decided to create a user defined language for pico8 in Notepad++.
I used the same color scheme as pico-8.

For those who don't know what this is, it changes the colors of text in Notepad++ depending on if the text is a command, a string, an operator (+ - = * /), or other keyword. Basically it makes Notepad++ look the same as typing inside of pico-8.

..Get Notepad++..
https://notepad-plus-plus.org/

..Download..
NP++ pico-8 user defined language xml
(Or you can copy and paste the Hidden Text into a text editor and use the file extension .xml.)


<NotepadPlus>
<UserLang name="pico8" ext="" udlVersion="2.1">
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="yes" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00-- 01 02 03 04</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
<Keywords name="Numbers, extras1"></Keywords>
<Keywords name="Numbers, extras2"></Keywords>
<Keywords name="Numbers, suffix1"></Keywords>
<Keywords name="Numbers, suffix2"></Keywords>
<Keywords name="Numbers, range"></Keywords>
<Keywords name="Operators1"> / + - = % ^ += -= = /= == != ~= > < ,</Keywords>
<Keywords name="Operators2"></Keywords>
<Keywords name="Folders in code1, open">( { [</Keywords>
<Keywords name="Folders in code1, middle"></Keywords>
<Keywords name="Folders in code1, close">) } ]</Keywords>
<Keywords name="Folders in code2, open">if function do for</Keywords>
<Keywords name="Folders in code2, middle">else then elseif</Keywords>
<Keywords name="Folders in code2, close">end</Keywords>
<Keywords name="Folders in comment, open"></Keywords>
<Keywords name="Folders in comment, middle"></Keywords>
<Keywords name="Folders in comment, close"></Keywords>
<Keywords name="Keywords1">in and or not local _update _draw _init return</Keywords>
<Keywords name="Keywords2">lua gfx gff map sfx music version</Keywords>
<Keywords name="Keywords3">false true nil</Keywords>
<Keywords name="Keywords4">sgn cls add del btn btnp spr sspr map music sfx all rnd flr camera line rect rectfill print circfill circ clip pget pset sget sset fget fset cursor color pal palt foreach pairs mget mset peek poke memcpy reload cstore memset max min mid cos sin atan2 sqrt abs rnd srand band bor bxor bnot shl shr menuitem cartdata dget dset sgn</Keywords>
<Keywords name="Keywords5"></Keywords>
<Keywords name="Keywords6"></Keywords>
<Keywords name="Keywords7"></Keywords>
<Keywords name="Keywords8"></Keywords>
<Keywords name="Delimiters">00" 01 02" 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" fgColor="C0C0C0" bgColor="808080" fontName="Consolas" fontStyle="0" nesting="0" />
<WordsStyle name="COMMENTS" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="LINE COMMENTS" fgColor="7272B8" bgColor="FFFFFF" fontName="Courier New" fontStyle="3" nesting="0" />
<WordsStyle name="NUMBERS" fgColor="2894FF" bgColor="FFFFFF" fontName="Consolas" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS1" fgColor="FF77A8" bgColor="FFFFFF" fontName="Consolas" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS2" fgColor="FF8000" bgColor="FFFFFF" fontName="Consolas" fontStyle="3" nesting="0" />
<WordsStyle name="KEYWORDS3" fgColor="0080FF" bgColor="FFFFFF" fontName="Consolas" fontStyle="3" nesting="0" />
<WordsStyle name="KEYWORDS4" fgColor="00E436" bgColor="FFFFFF" fontName="Consolas" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="OPERATORS" fgColor="FFFFFF" bgColor="FFFFFF" fontName="Consolas" fontStyle="1" nesting="0" />
<WordsStyle name="FOLDER IN CODE1" fgColor="FFFFFF" bgColor="FFFFFF" fontName="Consolas" fontStyle="1" nesting="0" />
<WordsStyle name="FOLDER IN CODE2" fgColor="FF77A8" bgColor="FFFFFF" fontName="Consolas" fontStyle="1" nesting="0" />
<WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS1" fgColor="2894FF" bgColor="FFFFFF" fontName="Consolas" fontStyle="2" nesting="0" />
<WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
</Styles>
</UserLang>
</NotepadPlus>

...Installation...
Import the .xml into Notepad++ under the toolbar:
Language >> Define your language >> Import >> .xml file

Let me know if I missed anything, and enjoy!

P#25691 2016-07-21 16:34 ( Edited 2017-11-30 03:08)

1

Thanks for taking the time to produce this Gyrobotic!

I hope you don't mind, but I took your idea a stage further and made the following additions/changes:

 • [b]CHG[/b]: Added the "p8" extension to the pico8 user defined language
      [i](so that it is automatically applied to .p8 files)[/i]
 • [b]CHG[/b]: Modified font colours and styles used to match native PICO-8 editor
 • [b]ADD[/b]: Created a new "PICO-8" Theme
      [i](so that the background colour, and other features, match PICO-8's editor)[/i]

-- DOWNLOAD--
PICO-8 Notepad++ Theme.zip

-- INSTALLATION--
1) Copy the "PICO-8.xml" theme file to the Notepad++ themes folder, which is typically:
C:\Program Files (x86)\Notepad++\themes
2) Import the "NP++pico8-v2.xml" file into Notepad++ by selecting from the main menu:
Language > Define your language > Import
3) Switch to the new PICO-8 theme by selecting from the main menu:
Settings > Style Configurator > Choose "PICO-8" from the theme drop-down.

Hope someone finds these useful (and thx again to Gyrobotic for doing most of the work!) :o)

P#27050 2016-08-18 10:26 ( Edited 2016-08-18 14:28)

Thank you, you two.

I rely a lot in Notepad++ when I actually code Pico-8 games, which means that I would get a lot of use from this.

P#27498 2016-08-27 21:24 ( Edited 2016-08-28 01:24)
1

Why would anyone punish themselves with the pico-8 font more than they have to? My primary reason for using another editor is to escape that. The other work here is interesting but the font??? The "B" alone (or is it an E, or a backwards 3, or Ɛ) makes me want to chew my toes off. I wish pico-8 would let me switch to another 3x5 font.

P#31216 2016-10-19 05:20 ( Edited 2016-10-19 09:20)

Have to agree with Juanitogan. Love the language, hate that the IDE that uses the font.

For runtime ? Sure, that's fine. But actual code editing ?

It's a bit much.

Gyrobotic, I have Notepad ++ open, I have PICO-8 .XML imported and docked. How do I activate it ?

It says it's active but does not change the screen colors, for instance, for "--" to start a REM.

Changing to the language of LUA, however, does work and tint.

P#31228 2016-10-19 11:15 ( Edited 2016-10-19 15:15)

Something has gone terribly wrong.
Send help.
https://i.imgur.com/zyZDpb9.png

P#44728 2017-09-28 19:56 ( Edited 2017-09-28 23:56)

Hey this is really great! :D
I already use Notepad++ for p8 so this is perfect.
I was thinking of switching to SublimeText because I use 4 different platforms and its nice having cross platform utilities. But I might just have to keep NP++.

System font seems to be more readable

P#46804 2017-11-28 23:56 ( Edited 2017-11-29 05:16)

Now we just need someone to make an external sprite and map editor :P

P#46805 2017-11-29 00:18 ( Edited 2017-11-29 05:18)

You can edit sprites using grafx2 then import them

Thanks for making this xml file, btw! I much prefer using np++ than the in-built pico-8 editor.

P#46824 2017-11-29 10:54 ( Edited 2017-11-29 15:54)

Thanks for the tip. I just got done putzing around with it.
To be honest I think the Pico-8 sprite editor is perfectly fine as is.

I still think the map editor could stand for some improvement.

P#46850 2017-11-29 22:08 ( Edited 2017-11-30 03:09)
2

Reviving a dead thread - Loved using above but it wasnt collapsing my functions correctly - to fix this, go into User Defined languages, and move "Do" from "start" to "middle" on the bottom right part like this:

then it will allow you to collapse functions properly! otherwise it got confused because of my for loops

P#116172 2022-08-23 12:29
1

I made a new version that includes all functions as of v0.2.5g. It also fixes some things that were broken before. Multi-line comments, syntax highlighting in edge cases, added missing operators, number/hex/decimal points, etc. I did a lot of testing to make sure all highlighting is accurate to PICO-8.

npp-pico8-v3.zip

I've included two versions of the .xml file. One is for .p8 files only and the other is for both .p8 and .lua. You only need to import one. There's also a theme included, but if you'd rather use your own, just keep in mind that this works best with a dark theme. More detailed instructions are included in the zip file.

Thanks to everyone else who worked on this.

P#130046 2023-05-22 23:40

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 10:46:33 | 0.012s | Q:32