mercredi 28 novembre 2007

Color Syntax Highlight Quick Look

This quick look plugin allow you to display source code with color.

It uses “hightlight” from http://www.andre-simon.de/he easiest way to install it is to use Fink.

How to install:
- In a Terminal do:
- sudo port install highlight
- hightlight must be in /opt/local/bin/highlight
- Copy ColorQC.qlgenerator to /Library/QuickLook
- Copy Unique Type Identifiers.app to your Applications folder
- That’s it.


If you want to add more file type, edit the file /Applications/Unique Type Identifiers.app/Contents/Info.plist and add:

<dict> <key>UTTypeConformsTo</key> <array> <string>net.samlepirate.uti.xml</string></array> <key>UTTypeDescription</key> <string>Visual Studio Project</string> <key>UTTypeIdentifier</key> <string>net.samlepirate.uti.vcproj</string> <key>UTTypeTagSpecification</key> <dict> <key>com.apple.ostype</key> <string>TEXT</string> <key>public.filename-extension</key> <array> <string>vcproj</string> </array> </dict> </dict>

before:

</array></dict></plist>

You need to change UTTypeDescription value to something that apply for your type, UTTypeIdentifier to a unique id, use net.samlepirate.uti.your-extension.

Finally add your extension to public.filename-extension.

You can modify UTTypeConformsTo to net.samlepirate.uti.xml or net.samlepirate.uti.text to specify that you want a standard xml parsing or a text parsing.