Friday, August 26, 2005

Using JEdit as external code editor for Processing

As you might know, the Processing IDE (to a large part) is based on the open source JEdit editor. Having grown fond of this powerful and customizable editor, I've been using it for most of my XML and programming tasks over the years, whenever Eclipse is a too big a gun to fire up. JEdit only becomes "truly" efficient via its many plugins available, but it also rocks in ease of customization.

Due to my new job I've become a semi-Mac user again (at least to 50%) and haven't got around installing much software yet. So using the existing definition for Java and some handy Regular Expressions I quickly converted the list of processing keywords (located in the file /lib/keywords.txt inside the Processing root folder) into a JEdit edit mode XML definition for PDE source files.

Brief note for installation:

1) put this file into the /modes directory inside the JEdit root folder
2) copy & paste the following XML node into the file "catalog" inside the same folder

<MODE NAME="processing" FILE="processing.xml" FILE_NAME_GLOB="*.pde" />

Syntax colouring/checking for PDE files should now be ready. Please do let me know any errors/suggestions. Maybe it'd be handy to include method names and constants of some common P5 libraries too?

Btw. If you're interested the JEdit RegExp used for turning the plaintext list into XML are here:

search pattern: ^(\w+)\t(\w+).*$
replace pattern: <$2>$1</$2>