Skip to content

Instantly share code, notes, and snippets.

@andygreen1 andygreen1/langs.xml
Last active Apr 2, 2020

What would you like to do?
Hack Pico-8 syntax highlighting into Notepad++
Adds Pico-8 syntax highlighting in Notepad++ by sacrificing regular Lua syntax highlighting -
I couldn't figure out how to add it as a custom language.
NB - some keywords that were added after ~0.1.9 are missing.
This file is normally located at C:\Users\<username>\AppData\Roaming\Notepad++\langs.xml
<?xml version="1.0" encoding="Windows-1252" ?>
<!-- The key words of the supported languages, don't touch them! -->
<Language name="lua" ext="lua" commentLine="--" tabSettings="129">
<Keywords name="instre1">and break do else elseif end false for function if in local nil not or repeat return then true until while</Keywords>
<Keywords name="instre2">_VERSION assert collectgarbage dofile error gcinfo loadfile loadstring print tonumber tostring type unpack _ALERT _ERRORMESSAGE _INPUT _PROMPT _OUTPUT _STDERR _STDIN _STDOUT call dostring foreach foreachi getn globals newtype rawget rawset require sort tinsert tremove _G getfenv getmetatable ipairs loadlib next pairs pcall rawegal rawget rawset require setfenv setmetatable xpcall string table math coroutine io os debug</Keywords>
<Keywords name="type1">abs acos asin atan atan2 ceil cos deg exp floor format frexp gsub ldexp log log10 max min mod rad random randomseed sin sqrt strbyte strchar strfind strlen strlower strrep strsub strupper tan string.byte string.char string.dump string.find string.len string.lower string.rep string.sub string.upper string.format string.gfind string.gsub table.concat table.foreach table.foreachi table.getn table.sort table.insert table.remove table.setn math.abs math.acos math.asin math.atan math.atan2 math.ceil math.cos math.deg math.exp math.floor math.frexp math.ldexp math.log math.log10 math.max math.min math.mod math.pi math.rad math.random math.randomseed math.sin math.sqrt math.tan</Keywords>
<Keywords name="type2">openfile closefile readfrom writeto appendto remove rename flush seek tmpfile tmpname read write clock date difftime execute exit getenv setlocale time coroutine.create coroutine.resume coroutine.status coroutine.wrap coroutine.yield io.close io.flush io.input io.lines io.output io.tmpfile io.type io.write io.stdin io.stdout io.stderr os.clock os.difftime os.execute os.exit os.getenv os.remove os.rename os.setlocale os.time os.tmpname</Keywords>
<Language name="lua" ext="lua p8" commentLine="--" tabSettings="129"> <!--<Language name="Pico-8" ext="p8" commentLine="--" tabSettings="129"> -->
<!-- pink keywords -->
<Keywords name="instre1">and break do else elseif end for function if in local not or repeat return then until while</Keywords>
<!-- blue keywords -->
<Keywords name="instre2">false true nil</Keywords>
<!-- green functions -->
<Keywords name="type1">abs add all assert atan2 band bnot bor btn btnp bxor camera cartdata circ circfill clip cls cocreate color coresume cos costatus cstore cursor del dget dset exit fget flip flr foreach fset line map max memcpy memset menuitem mget min mid mset music pairs pal palt peek pget poke print printh pset rect rectfill rnd setmetatable sfx sget shl shr sin spr sqrt srand sset sspr stat sub time type yield</Keywords>
<!-- reserved function names -->
<Keywords name="type2">_draw _init _update</Keywords>
<!-- system functions -->
<!--<Keywords name="type2">cd folder info load ls mkdir reboot reload resume run save</Keywords> -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.