Syntax Highlighting for SPIN files on TextWrangler
pgbpsu
Posts: 460
Although I find the Propeller Tool to be great at everything I ask it to do, the one thing it requires is windows to be running first. Because I do almost everything else on a Mac, I'd like a an editor that runs natively on the Mac which would have many of the features of the Propeler Tool. I'm not looking for a compiler just an editor. There are lots of fine editors out that which would get one close to the highlighting of the Propeller Tool. One such editor is TextWrangler for the Mac. One of the things I like most about this editor is the ability to split the screen horizontally and see two different parts of the same file (or the same part twice, but I don't think that's very useful). Since prop files are just text TextWrangler can already be used to edit them. In fact, I'm sure some forum users already do this. And I could as well, I've just really grown to like the highlighting the Prop Tool does. What I want to do (and maybe some has already beaten me to it) is write the Codeless Language Module for TextWrangler/BBEdit that would at least give users highlighted reserved words. I followed the example in the TextWrangler manual but (at least the version I have) it never indicates where to save the new plist file. I've attached the plist file I put together in case anyone wants to try it. But I haven't actually gotten it to work. I'm not sure if it's a problem with the plist file, or where I'm saving it. I put my copy in
If I can get this to work, I'll try to do block highlighting next. Anyone know where this file really belongs? Anyone already done this?
Regards,
pgb
p.s. I had to zip the spin.plist file to get the Attachment Manager to accept it.
I finally got this to work. Sort of. It recognizes all the reserved words in SPIN, but it fails to highlight := <>, etc. Basically it only gets the words. There's some re-exp that stuff that I'm missing, but it's a start. Anyone who would like to have basic syntax highlighting in TextWrangler or BBEdit can download the attached file zip file, uncompress it, and save it as:
~/Library/Application Support/TextWrangler/Language Modules/spin.plist
If anyone adds to this to increase/expand its functionality please post it back here so the rest of us can take advantage.
Post Edited (pgbpsu) : 10/21/2008 3:04:43 AM GMT
~/Library/Application Support/TextWrangler/Language Modules/spin.plist
If I can get this to work, I'll try to do block highlighting next. Anyone know where this file really belongs? Anyone already done this?
Regards,
pgb
p.s. I had to zip the spin.plist file to get the Attachment Manager to accept it.
I finally got this to work. Sort of. It recognizes all the reserved words in SPIN, but it fails to highlight := <>, etc. Basically it only gets the words. There's some re-exp that stuff that I'm missing, but it's a start. Anyone who would like to have basic syntax highlighting in TextWrangler or BBEdit can download the attached file zip file, uncompress it, and save it as:
~/Library/Application Support/TextWrangler/Language Modules/spin.plist
If anyone adds to this to increase/expand its functionality please post it back here so the rest of us can take advantage.
Post Edited (pgbpsu) : 10/21/2008 3:04:43 AM GMT
Comments
To use it, start TextMate and open the bundle editor and create a new bundle for Spin, then copy the code above into the bundle.
-Chuck-
@Chuck-
I've downloaded TextMate. Seems quite powerful and possibly worth the cost to buy, but I can't get your bundle code to do anything. Here's what I did:
1. fire up textmate
2. pull up the Bundle Editor
3. add new language
4. past your snippet over the code that was already there
5. now I've got a new language called My Bundle with a subfolder named Spin. That's where your code went. I left the Activation Key and Scope Selector empty. When I quite TextMate and restart, then load a .SPIN file I get the spin file but without any highlighting save mis-spelled words.
Does one need to register to get this feature?
@Chuck-
It's working now. I must not have quit TextMate, rather just closed the current window. I'll tinker around with this to see if I can get some of the other highlighting working. Nothing like procrastination....
Thanks,
pgb
Post Edited (pgbpsu) : 10/20/2008 2:04:50 PM GMT
If you come up with an improved hilite scheme send a copy back my way! [noparse]:)[/noparse] -Chuck-
"If you come up with an improved hilite scheme send a copy back my way! [noparse]:)[/noparse] -Chuck-"
Will do, however, I'm still leaning toward TextWrangler. I'm more familiar with it and it's free!
p
But TextMate is a better programmers editor. I use both, but tend to favor BBEdit for editing HTML pages and TextMate for source code. TextWrangler has support for many more languages than BBedit, even though BBedit is Much, MUCH older. All three (BBedit, TextWrangler, and TextMate are all good editors. A SPIN hilighter would be good for each.
I got something working with TextWrangler which should also work with BBEdit. One of the features that TextWrangler lacks that I believe is present in BBEdit and TextMate is "text folding" for collapsing blocks of code. I'm not sure this enough for me to buy either TextMate or BBEdit, but it would be nice. If only there was someway to add spin highlighting to XCode I'd be all set.
Nonetheless, I edited the first post and replaced the uploaded file with the most recent. As the first post now indicates, the attached codeless language module should add reserved work and comment highlighting to TextWrangler and BBEdit. Unzip and place where indicated....
pgb