|
FAQ
Frequently Asked Questions
Featured Here are some questions I expect to get.
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). 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. 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. 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: 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: 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: 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. Just drag the bundle from ~/Library/QuickLook or /Library/QuickLook into the trash. |
► Sign in to add a comment
Great plugin! Thank you. somehow my sql files default generator changed to "Text.qlgenerator". any idea how to fix this back to qlcolorcode?
Good question. I've added some info above.
How do I make this fantastic plugin quicklook csv files as well?
It'd be great if it could look at .sci scilab files too, which is supported by Highlight.
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
@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.
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...
@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
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!
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/nullreally good plug-in works good on lion, any chance to see the leading line number? thanks