Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

10.5: View syntax-highlighted source code in Quick Look System 10.5
There's a new free Quick Look plug-in (Plug-in [338KB] | Source [469KB]) which allows one to display source code with color syntax highlighting. It uses the Highlight package, which means it supports a ton of languages.

This page will help you add more supported file types to the plug-in.

[robg adds: Given how new Quick Look is, and how very useful it is, I've chosen to run hints on various plug-ins that add functionality to Quick Look. My requirements for a plug-in to be "hintable" are that they must be free, and ideally (as with this one) also open source. I don't anticipate we'll have a ton of such hints; there are only so many file types to be Quick Looked, after all.]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[5,045 views]  

10.5: View syntax-highlighted source code in Quick Look | 13 comments | Create New Account
Click here to return to the '10.5: View syntax-highlighted source code in Quick Look' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Quick Looked?
Authored by: jecwobble on Tue, Dec 11 2007 at 8:20AM PST
Are we coining new verbs now, Rob? ;-)
I'll google it to see if you are the first...
Nope, looks like one of your submitters beat you to it (perhaps where you got it from?): http://www.macosxhints.com/article.php?story=20071030002650655

[ Reply to This | # ]
Quick Looked?
Authored by: jecwobble on Tue, Dec 11 2007 at 8:21AM PST
Well, I take that back. That post appears to be coining an adjective.

[ Reply to This | # ]
Quick Looked?
Authored by: itistoday on Tue, Dec 11 2007 at 8:44AM PST
Amusing.

[ Reply to This | # ]
10.5: View syntax-highlighted source code in Quick Look
Authored by: Eric Coleman on Tue, Dec 11 2007 at 8:30AM PST

So... this doesn't work for me, I get the following errors:


12/11/07 11:22:03 AM [0x0-0x1ac1ac].highlight[89302] highlight: Configuration file ./filetypes.conf not found. 
12/11/07 11:22:03 AM [0x0-0x1ac1ac].highlight[89302] highlight: Unknown source file extension "php". 


[ Reply to This | # ]
10.5: View syntax-highlighted source code in Quick Look
Authored by: itistoday on Tue, Dec 11 2007 at 8:42AM PST
I'm getting the same errors. It displays some in courier font, but no color.

[ Reply to This | # ]
10.5: View syntax-highlighted source code in Quick Look
Authored by: mjb on Tue, Dec 11 2007 at 11:33AM PST
I noticed that several languages appeared to not be highlighted. Upon closer inspection, the included version of highlight was missing a large number of language definitions.

My fix for this was to download the source for highlight, and copy in all the missing language definitions from that to the Contents/Resources/langDefs (I think) folder within the plugin package.

[ Reply to This | # ]
10.5: View syntax-highlighted source code in Quick Look
Authored by: ejensen on Tue, Dec 11 2007 at 8:43AM PST
This package has an Intel-only "highlight" utility included so it does not work on ppc Macs. I tried rebuilding it using a Universal "highlight" binary (an older version) but it did not work. I am hoping a someone with more Xcode savvy can rebuild and post a ppc or truly universal version.

[ Reply to This | # ]
10.5: View syntax-highlighted source code in Quick Look
Authored by: freddiepingpong on Tue, Dec 11 2007 at 8:46AM PST
I get the same error as those above on an intel MacBook.

I've tried to move config files around to resolve the dependencies, but nothing.

[ Reply to This | # ]
10.5: View syntax-highlighted source code in Quick Look
Authored by: somorjai on Tue, Dec 11 2007 at 9:43AM PST
I have compiled a UB version, but I can't test the PPC version. If anyone would be brave enough to check it, drop me a mail.

Akos

[ Reply to This | # ]
10.5: View syntax-highlighted source code in Quick Look
Authored by: orso on Tue, Dec 11 2007 at 9:19PM PST
I managed to compile a PPC version of highlight from the source, then I substituted the actual version of highlight in the Quick Look plugin (Contents/Resources/highlight) with the result of the compilation. And it worked immediately on my PB G4.

As a second step, I have added a few of the styles present in the source of highlight to those present in the plugin (Contents/Resources/langDefs), so now Quick Look manages correctly also .tex files.

Finally, I didn't need to compile the plugin from the source (but admittedly, I failed in trying) to have a PPC working syntax-highlighting Quick Look.

Hope this helps.

[ Reply to This | # ]
10.5: View syntax-highlighted source code in Quick Look
Authored by: laax on Tue, Dec 11 2007 at 9:09AM PST
Actually I think this plugin is nicer. Does the same thing but worked on .tex files too: plugin

But maybe both are customizable? I find that they lack a lot of languages like SML, Erlang, Elisp, etc.

[ Reply to This | # ]
10.5: View syntax-highlighted source code in Quick Look
Authored by: laax on Tue, Dec 11 2007 at 9:12AM PST
10.5: View syntax-highlighted source code in Quick Look
Authored by: mjb on Tue, Dec 11 2007 at 11:42AM PST
If you update the language definitions as I mention in my previous comment, You'll get all the languages you mention :)

[ Reply to This | # ]