Search code examples
jeditprocessing

How to add new programming language to jEdit?


I've recently been learning the Processing programming language. Processing includes an IDE called the Processing Development Environment (PDE), but the editor is quite basic.

The IDE has an option to use an external editor. One of my preferred editors is jEdit due to it's cross-platform support. Jedit has built-in support for over 170 languages, but not processing which I guess is still a little bit too niche at the moment.

How do I add Processing with all the color highlights to jEdit?


Solution

  • The whole process for adding processing has been detailed here: http://wiki.processing.org/w/JEdit_as_External_IDE.

    Basically, jEdit is using XML files to define syntax coloring rules (incl. simple checking) for its various editing modes. Each syntax definition file has a file extension mapping to tell jEdit which language mode to use for individual files. For Processing files we will use the standard .pde extension.

    There are two things you need to do: (Before installing any of the files below, please make sure jEdit is not running.)

    1. Syntax Highlighting

    Download File:Processing.xml into the "modes" folder inside your jEdit installation.

    On Linux/MAC this is usually /usr/share/jedit/modes

    On Windows this is C:\Program Files\jEdit\modes

    Then copy and paste the following XML node into the file "catalog" inside the same folder and syntax coloring/checking for PDE files should be ready: <MODE NAME="processing" FILE="Processing.xml" FILE_NAME_GLOB="*.pde" />

    1. Abbreviations

    Download Media:abbrevs_v0.1.zip and extract it into the right folder for your system:

    Windows

    C:\Documents and Settings\{USERNAME}\.jedit
    

    Mac

    /Users/{USERNAME}/.jedit
    

    Note: This folder is not visible in the Finder. Unzip the file in your home folder, open a terminal window and type: mv ~/abbrevs ~/.jedit/abbrevs</source>

    Linux

    Find the location of the jEdit settings directory via the menu: Utilities > Troubleshooting > Activity log, then extract/copy the file in that folder.

    For all systems, you'll need to restart jEdit in order for the abbreviations to come in effect.