from: http://mikesmithers.wordpress.com/2010/02/23/plsql-syntax-highlighting-in-textpad-for-when-you-cant-play-with-penguins/


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 :


plsql.syn




Once we’re done, save the file under the Textpad Home system directory ( usually C:\Program Files\ Textpad n\System ( where n is the version of Textpad you’re using).

Step 2 – Setup a New Document Class

Open Textpad and select the Configure menu then New Document Class. You’ll then get a series of dialog boxes to step through.

Specify the class name as PL/SQL

Class members – the file extensions for which this definition file is to be used (*.sql, *.fnc, *.pkb, *.pks, *.prc, *.trg, *.tbl)

Check Enable Syntax Highlighting
Syntax Definition File :

select plsql.syn from the drop-down

Finally, hit Finish.

Step 3 – Configure the PL/SQL Class

Close and restart Textpad.

In the Configure menu, select Preferences

Select Document Classes from the Tree in the left hand pane

PL/SQL should be there.

In the Document class options, you can set further preferences, mine are usually :

Maintain indentation
Word wrapped text : Save with no breaks in lines
Default encoding : ANSI
Create new files as : PC

If the mood takes you, you can also specify the colours to be used for each class of keyword you specified in the definition file. I usually leave them at the default ( but then, I never was artistic).

When it comes to running code written in Textpad, I usually just run a command line from within Textpad( Tools/Run then cmd in the command dialog) and start a sqlplus session.

The command session starts in the same directory as the saved file in focus in Textpad, which is handy for making quick edits as you can just switch between Textpad and the command prompt.

'Programming' 카테고리의 다른 글

TextPad 단축키 (My)  (0) 2012.07.03
[펌] SNMP Trap  (0) 2012.06.20
Windows 정품인증 상태 확인 방법  (0) 2012.06.20
Posted by 세모아
,