How to Set Up EA Syntax Highlighting in Notepad++

Hi there! This is just a short and simple step-by-step process for a beginner buildfile user on how to set up EA syntax highlighting within Notepad++. Buildfiles are often a daunting process for new learners (myself included) and if I can even slightly ease the burden for anyone first getting into them, I’m grateful.

For this, we’ll be using Snek’s syntax highlighting for EA scripts, found here:

I actually cleaned up his Textprocess highlighting, so if you’d like my version you can find it on my project’s Github.)

Once you’ve downloaded the .xml files, now the real fun begins.

Step One: Import UDLs (User Defined Languages)

By default, all files in Notepad++ will highlight the syntax using plain text, and that is to say, not at all.

This is a village event from the prologue in my hack highlighted in plain text. Don’t your eyes just glaze over looking at this? Let’s try to make it easier to parse. Go to Language at the top of Notepad++, highlight over User Defined Language, and click Define Your Language…

From here, Import each of the .xml files you downloaded. Close Notepad++ and open it again, and each UDL should appear under Language. Let’s try giving our .event file the Event Assembler syntax highlighting!

Uh oh.

Step Two: Making it actually look good

So while the highlighting properly color coded the event opcodes, macros, and comments, the black background on all other text is certainly distracting. We fix this by overriding the global background color for everything in Notepad++.

Navigate to Settings → Style Configurator. In Colour Style, click the swatch next to Background and set it to the first black. Check “Enable global background colour”, click Save and Close, and voila! Our .event file looks presentable.

If you’re satisfied with how this looks, there’s just one more minor step. You’ll notice that every time you click on a line, it’ll highlight it in this blinding white that makes most of the text unreadable. We fix this by going into Settings → Preferences → Editing, then choosing a different setting for Current Line Indicator.

Bonus Step: Snazzing it Up

This step may be obvious if you’ve fiddled around with the Style Configuration menu, but there are a lot of themes you can use in case you don’t like the pitch black background. Go into the Select Theme dropdown menu and choose whichever theme you like best. You can change the font settings here too and make them global.

One slight benefit of choosing a non-default theme is that you don’t need to change the Current Line Indicator setting.

This is my final setup. I like the Solarized theme with 11 pt Consolas font. Feel free to fiddle around with theme and font settings to find a syntax highlighting that works for you.

This was an extremely simple and straightforward guide, though I hope it was useful to at least one person. I wish everyone the best of luck in their eventing endeavors. Thank you, and thank Snek for making the EA syntax highlighting in Notepad++ to begin with.

9 Likes

Hello! Sorry for the necro if that bothers people here. But I’d like to utilize the cleaned-up version mentioned above, and the link (originally) in the quoted bit appears to have died.

1 Like

Github has history, so as long as Dragz doesn’t hide / delete the repo, we can access the original file here:
https://github.com/GigaExcalibur/Devotia-Exhibition/blob/a7656efcc06356abe1a5f373fdbedb171c9f07ad/Text/TextLanguage.xml

2 Likes

Oh, thank you!
Github is still a strange and confusing place for me.

1 Like

Dw, it sometimes feels that way for me too. But you’ll get there eventually if you just commit!

2 Likes

I must be doing something wrong. When I try to import any of the .xml files, I get this popup.
image

It’s possible my unfamiliarity with github meant I downloaded things wrong? Or maybe I’m going about the importing process incorrectly?

1 Like

Can you try with the one Snek made? His guide is linked in the first post here.

Generally for github if it’s a text file you click raw, select all, copy, and paste it into notepad and save it as whatever filename/extension it had on github. Or use gitzip extension to download a folder.

2 Likes

I just tried re-importing the .xml file for myself and it worked fine. Did you download the raw file from GitHub or copy its contents into your own text file?

But yes, try with the one Snek uses to see if the issue still persists.

1 Like

I’d tried all of them, and none of them were working.
I guess I’d made a mistake by trying to download the file directly. After copying the contents into an empty text file and changing the extension, I got them to work.
Sorry. I am still baby modder and github is a strange and confusing place.

2 Likes

It’s strange that the files wouldn’t work unless you copied their contents into an empty file and changed the extension, but I’m glad you got it working in the end. Lmk if you experience any other issues!

1 Like