PL/SQL Syntax Highlighting in Textpad – for when you can’t play with Penguins
When I’m mucking around at home, it’s Linux all the way. Unfortunately, at work ( in desktop terms, at least) I’m still stuck with being a Microsofty.
This leaves me with Textpad as my program editor of choice.
As promised then, here’s the quick and dirty guide to enabling syntax highlighting for PL/SQL in Textpad ( works for versions 4 and 5) …
Step 1 – write a syntax definition file
This file is split into sections :
The first line tells textpad how the language in question is likely to be structured. In the case of PL/SQL, it’s a ‘C’ like language in this sense ( pretty standard 3GL), so we specify :
This is followed by the syntax section, most of which is fairly self-explainatory :
Namespace1 is set to 6 because we’re going to divide our keywords into six different categories, each of which can – if we so wish – be highlighted using a different colour.
In this example, I’ve split the keywords into six categories :
- SQL keywords
- SQL functions
- PL/SQL keywords
- SQL*Plus formatting commands
- Other SQL*Plus commands.
The entire file looks like this :