Intergalactic ramblings of the RocketWerx & RocketTheme staff...

Useful developer tip for QuickLook users

RocketWerx

| Written by Andy | Wednesday, 14 May 2008 04:40

I don't know if your like me, but I really love the QuickLook feature in OS X 10.5 Leopard. It's one of those things that after you've started using it, you can't understand how you ever got along without it before. My workflow and general productivity went up at least 50% when I switched from a PC to a Mac running OS X 10.4 Tiger, and I think 10.5 has helped me get about 10-20% more efficient than that. Basically what QuickLook does for you is when your navigating around your files in Finder, you can click the space-bar and instantly get a preview of that file zoomed-in on your desktop. Of course the caveat behind this is that by default Leopard supports very few formats and all the useful ones us developers want to look at, only show a big version of the icon, which helps me not!

Have no fear however, there's a great resource available called the qlplugins.com and contains some really great plugins. My two favorites are:

  • BetterZip - QuickLook into archive files: IP, TAR, GZip, BZip2, ARJ, LZH, ISO, CHM, CAB, CPIO, RAR, 7-Zip, DEB, RPM, StuffIt’s SIT, DiskDoubler, BinHex, and MacBinary.
  • QLColorCode - QuickLook with syntax highlighting for a variety of files.

O.K. So hurray, now I can quickly open .zip and .tgz archives to see what's in them, and I can also quickly look at HTML and PHP files with nice syntax highlighting, but hey! CSS is missing! It's still showing an icon! Well i've got an easy fix to enable CSS quicklook with syntax highlighting too:

Step 1

Navigate to where you installed QLColorCode. For me it's ~/Library/QuickLook/QLColorCode.qlgenerator. Right-click on this file and choose: Show Package Contents. This will popup a new Finder window with the package context expanded.

Step 2

Navigate to: Contents -> Resources -> override -> config. Then open up filetypes.conf in your favorite editor of choice (of course that's Textmate).

Step 3

Scroll down the file to about line 46, under the last '$ext' entry. and add:

$ext(css)=css

Save the file, and bring up a Terminal window, then type:

qlmanage -r 

This reloads all the QL Generators and their configurations. Now find a .css file and hit the space bar. Voila!

2008 RocketWerx, LLC - All Rights Reserved