Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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 2.60 / 5
  You rated: 4 / 5 (5 votes cast)
 
[8,560 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 whoever posted them. This site is not responsible for what they say.
Quick Looked?
Authored by: jecwobble on Dec 11, '07 08:20:17AM
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 Dec 11, '07 08:21:50AM

Well, I take that back. That post appears to be coining an adjective.



[ Reply to This | # ]
Quick Looked?
Authored by: itistoday on Dec 11, '07 08:44:31AM

Amusing.



[ Reply to This | # ]
10.5: View syntax-highlighted source code in Quick Look
Authored by: Eric Coleman on Dec 11, '07 08:30:09AM

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 Dec 11, '07 08:42:25AM

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 Dec 11, '07 11:33:29AM

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 Dec 11, '07 08:43:01AM

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 Dec 11, '07 08:46:57AM

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 Dec 11, '07 09:43:43AM

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 Dec 11, '07 09:19:33PM

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 Dec 11, '07 09:09:58AM
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 Dec 11, '07 09:12:40AM
10.5: View syntax-highlighted source code in Quick Look
Authored by: mjb on Dec 11, '07 11:42:51AM

If you update the language definitions as I mention in my previous comment, You'll get all the languages you mention :)



[ Reply to This | # ]