Photo by Anas Alshanti on Unsplash
Contents
Getting started
Let’s walk through setting up Notepad++ to highlight (and run!) Euphoria files.
Download
Head over to the Download Notepad++ page and grab the latest Notepad++ Installer 32-bit x86 package. You should use the 32-bit version regardless of your Windows installation; the 64-bit version of Notepad++ doesn’t support many plugins. You’d only need a 64-bit editor if you were working with files that are over 1-2 GB a piece.
Installation
To be honest, I’m not going to step through the installation here. Just run the installer and accept the defaults.
Configuration
Download UDL
I have created an updated User Defined Language file for Euphoria 4.1. This file will add syntax highlighting to Notepad++.
You can get it on the Downloads page. Here is a direct link: Euphoria.xml (6kB)
Import UDL
- Launch Notepad++ and then click Language > Define your language…
- Click Import, browse to the Euphoria.xml file you downloaded, and click Open.
- A message should say Import successful.
- Change the User language dropdown to Euphoria and verify the settings.
- Click Language > Define your language… again to close the UDL panel.
Test UDL
Now open a Euphoria file, such C:\Euphoria\demo\win32\window.exw
, to see the syntax highlighting works correctly.
Add a launcher
Now we’ll add a couple hotkeys to launch Euphoria programs directly from Notepad++.
Rekey Run command
I like to use F5
to run Euphoria programs, but this is the default key for the Run… dialog in Notepad++.
- Click Run > Modify Shortcut/Delete Command…
- Select the Main Menu tab.
- Scroll all the way down and select the Run command (line 269).
- Click Modify and change this to
Shift+F5
and click OK. - Click Close to close the Shortcut mapper dialog.
Add new command
The Notepad++ Run command doesn’t have a “start in” directory option, which is useful for ensuring that your program starts in its “home” directory. That way, you can reference files in the local directory from code, and ex.err
files will be generated in the same directory.
To remedy this, I created a small program called startw.exw, which you can also find on the Downloads page.
Here’s how to use it:
- Download startw.exw and place it into your
C:\Euphoria\bin
directory. - In Notepad++, click Run > Run…
- Paste in the following command:
C:\Euphoria\bin\euiw.exe C:\Euphoria\bin\startw.exw -d "$(CURRENT_DIRECTORY)" C:\Euphoria\bin\euiw.exe "$(FILE_NAME)"
- Click Save…
- Name the command
Run in Euphoria
and selectF5
as the hotkey. - Click Cancel to close the Run dialog.
Now you can run your Euphoria applications by simply pressing F5
. We’ll explore additional commands in future articles.