My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
FAQ  
Frequently Asked Questions
Featured
Updated Oct 28, 2009 by n8gray@gmail.com

Here are some questions I expect to get.

  1. How will I know when a new version is released?
  2. Google offers an RSS feed for the "Downloads" page of this project for you to subscribe to. You can do this in Mail.app, for example. You can also use the RSS FWD service to have that feed forwarded to you as e-mail if you're not hot on RSS (but really, you should be).
  3. Why doesn't it highlight my Bozoscript .bozo files?
  4. The plugin tells the system, "I can display anything of type public.source-code" but it's up to the system (Launch Services, to be precise) to figure out what extensions, mime-types, and such have that type. For extensions like .c or .py the system already knows that they're source code, but for .bozo and other "exotic" file types somebody needs to tell it. I've included a few random "interesting" file types in the Info.plist file in the plugin's bundle to take care of this, but it's probably not wise to include everything that Highlight can handle. Why not? Well, if two different entities make conflicting claims on a given file extension then only one of them can win. For the gritty details, see Apple's UTI docs and this message.
  5. QLCC used to handle my .xyz files but suddenly they stopped working!
  6. This happens to me too. I suspect sunspots or other disturbances of the luminiferous ether are to blame. Your best bet is to try the procedures outlined in FAQ 5. See also ImportantNoteForXcodeUsers.
  7. How can I figure out what QL plugin is being used for a file?
  8. You can use the qlmanage tool to figure out what type the OS thinks a given file is and what generator it uses for it. Here's a Leopard example:
    [n8gray@golux]% qlmanage -p Notes.txt 2>&1 | grep 'Generator used'
    2008-01-07 13:50:57.476 qlmanage[56917:5f03] [QL] Previewing /Users/n8gray/src/flickr/Notes.txt. Content type UTI: public.plain-text. 
    Generator used: <QLGenerator /System/Library/Frameworks/QuickLook.framework/Resources/Generators/Text.qlgenerator>
    In Snow Leopard the command has changed. You cannot use grep to isolate the line you're interested in. (Why, Apple, why?) Luckily it only produces a handful of lines instead of many screens worth:
    [n8gray@golux]% qlmanage -d 1 -p beep.c
    Testing Quick Look preview with files:
            beep.c
    ...
    [DEBUG] Previewing /Users/n8gray/src/beep/beep.c. Content type UTI: public.c-source. 
    Generator used: <QLGenerator /Users/n8gray/Library/QuickLook/QLColorCode.qlgenerator>
    ...
    If you're looking at a file type that Launch Services doesn't know about, you'll see that the Content type UTI gets set to dyn.(random junk). For example:
    2009-01-07 13:03:05.146 qlmanage[18253:5f03] [QL] Previewing /Users/n8gray/src/QLColorCode/foo.bozo. Content type UTI: dyn.ah62d4rv4ge80e554r6. 
    Generator used: <QLGenerator /Users/n8gray/Library/QuickLook/EPSQLPlugIn.qlgenerator>
  9. I added a Bozoscript section to Info.plist but my .bozo files still quicklook like generic icons! WTF?
  10. If the command from the previous FAQ tells you that the UTI is dyn.something or the generator used is not QLColorCode, then you probably need to nudge Launch Services so it knows something has changed. Here are some things to try:
    • Read ImportantNoteForXcodeUsers
    • Move the plugin to a new location, then move it back.
    • qlmanage -r will reset QuickLook's caches.
    • touch ~/Library/QuickLook/QLColorCode.qlmanager may get Launch Services' attention.
    • /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f -v ~/Library/QuickLook/QLColorCode.qlmanager should really get Launch Services' attention, but it's hard to type.
  11. Can you add official support for Bozoscript?
  12. If it's supported by Highlight then the answer is probably yes. If it's not supported by highlight then the answer is also probably yes, but only if you're willing to write the highlight support. Assuming the language is supported by highlight, I'll need some info about the language in order to create a Universal Type Identifier for it:
    1. The name of the language
    2. The file extension(s) it uses
    3. The website of the organization in charge of the language (if possible)
    4. (optional but potentially very helpful) The Info.plist file from a major Mac software package that handles files of this language.
    Once you've got that information, mosy on over to the Issues page and file an issue. That is the highly preferred way for you to make new language requests. If you send them as e-mail, leave them as comments on my blog, or leave them in other random places there's a very good chance I'll overlook or forget about them.
  13. I thought QLColorCode used Pygments as its highlighting engine.
  14. Sorry, that's not a question. :-) Actually, it did use Pygments, but now it uses Highlight. Pygments is a nice project, but the Highlight engine is about 10x faster and supports more languages. One nice aspect of QLColorCode's design is that the highlighting engine can be swapped out quite easily if something better comes along.
  15. This is awful! How do I uninstall QLColorCode?
  16. Just drag the bundle from ~/Library/QuickLook or /Library/QuickLook into the trash.
Comment by serkan.o...@gmail.com, Dec 28, 2008

Great plugin! Thank you. somehow my sql files default generator changed to "Text.qlgenerator". any idea how to fix this back to qlcolorcode?

Comment by project member n8gray@gmail.com, Jan 7, 2009

Good question. I've added some info above.

Comment by rudro.ra...@gmail.com, Feb 27, 2009

How do I make this fantastic plugin quicklook csv files as well?

Comment by dexter.n...@gmail.com, Jun 9, 2009

It'd be great if it could look at .sci scilab files too, which is supported by Highlight.

Comment by duno...@gmail.com, Oct 22, 2009

I don't like to have .sh at the end of my shell scripts, is there a way to set qlmanage to use your plugin with these files instead of just showing the thumbnail?

Content type UTI: public.unix-executable. Generator used: None

Comment by project member n8gray@gmail.com, Oct 24, 2009

@dunolie: If you add public.unix-executable to the list of UTIs at the top of QLCC's Info.plist file (next to public.plain-text and public.xml, for example) then it will attempt to handle shell scripts with no extension. However, this also means executable binary files will get sent to the plugin. I think this should be OK, but I'm not 100% sure. Feel free to try it out!

@rudro.rana.biswas and dexter.nicholas: Please see question 6 above, though I think csv files should already work.

Comment by wolf.mce...@gmail.com, Nov 21, 2009

This is a great plugin!! But how can I disable any given filetype from being displayed with QLCC/highlight?

Files in ~/Library/Logs/ (usually) have the extension ".log". Those can be displayed by Leopard directly, no additional plugin needed. As soon as QLCC is installed, it takes over - or at least is given the file to display (as seen with qlmanage -p). As highlight has no idea about logs (what a shame) is coughs up an error in the system log. And that is annoying to the max, if you happen to have 500 log files and screenfulls of error messages in the console log.

I know its highlights "fault", not QLCC, but still, I would like to deactivate QLCC for log-files. Is there a way to do so?

FWIW: I have tried editing the Info.plist to add com.apple.log (the logs UTI), but that didn't help... (How could it, since highlight still has no idea of how to color a log).

I'm deliberately not writing this in "issues" (above) as I don't see this as a bug of QLCC. I wonder why the file is handed over to QLCC in the first place. Leopard should keep files to itself, if it knows how to handle them...

Comment by project member n8gray@gmail.com, Nov 21, 2009

@wolf.mcewen: Don't worry -- issues are not just for bugs and they don't imply anything negative. They're just a way of making sure your request doesn't fall through the cracks. This may require some conversation so I'm opening an issue for you:

http://code.google.com/p/qlcolorcode/issues/detail?id=53

Comment by mhannem...@gmail.com, Jan 7, 2010

This is just what I needed to use Quick Look for lisp files. No syntax highlighting, but now I can skim through them, at least! Great!

Comment by sethmill...@gmail.com, Jan 11, 2011

Re: How can I figure out what QL plugin is being used for a file? on Snow Leopard

If you add -o /dev/null, you can use grep again. FWIW, here's a script I use for commandline previews; I keep it in ~/bin/ql.

#!/bin/sh
if [[ $# == "0" ]]; then
    echo "Show a QuickLook preview from the commandline."
    echo
    echo "Usage: "
    echo
    echo "`basename $0` [-t] filename"
    echo
    echo "  -t shows the filetype and QuickLook generator that will be used to generate the preview."
    exit 1
fi

if [[ $1 == "-t" ]]; then
    qlmanage -d 1 -o /dev/null -p "$2" 2>&1 | grep "Generator used" | awk -F'type ' '{print $2}' | uniq
    exit 0
fi

qlmanage -p "$@" >& /dev/null
Comment by gianmari...@gmail.com, Jul 31, 2011

really good plug-in works good on lion, any chance to see the leading line number? thanks


Sign in to add a comment
Powered by Google Project Hosting