Setup Notepad++ to edit Euphoria code

Posted

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

  1. Launch Notepad++ and then click Language > Define your language…
  2. Click Import, browse to the Euphoria.xml file you downloaded, and click Open.
  3. A message should say Import successful.
  4. Change the User language dropdown to Euphoria and verify the settings.
  5. 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++.

  1. Click Run > Modify Shortcut/Delete Command…
  2. Select the Main Menu tab.
  3. Scroll all the way down and select the Run command (line 269).
  4. Click Modify and change this to Shift+F5 and click OK.
  5. 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:

  1. Download startw.exw and place it into your C:\Euphoria\bin directory.
  2. In Notepad++, click Run > Run…
  3. 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)"
  4. Click Save…
  5. Name the command Run in Euphoria and select F5 as the hotkey.
  6. 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.

Author
Categories Beginner, Windows