Quick Look is one of the coolest features of OS X Leopard.
Unfortunately it only supports a limited range of file types.
I blogged before how I got Quick Look to display
.properties
files.
Lately I am playing a lot with Groovy... and
.groovy
files are also not supported by Quick Look out of the box.
Finally I got Quick Look working to show
.groovy
files. But it has been quite a hassle.
In the following I am using TextMate, but this should also work with another text-editor like Smultron or TextEdit.
This is what I did:
Contents/Info.plist
with a text-editor.
Info.plist
(just before the ending </dict> </plist>)
UTExportedTypeDeclarations UTTypeConformsTo public.text public.plain-text UTTypeDescription Code UTTypeIdentifier com.macromates.textmate UTTypeTagSpecification com.apple.ostype TEXT public.filename-extension properties groovy
.groovy
files.
Then I did the following steps on the command-line, without really knowing what they do. Probably not all of them are necessary:
touch /Applications/TextMate.app
qlmanage -r
touch ~/Library/QuickLook/QLColorCode.qlmanager
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f -v ~/Library/QuickLook/QLColorCode.qlmanager
The result is that QuickLook at least displays
.groovy
files as plain text:
Next on the wishlist would be syntax-highlighting. Unfortunately this does not work with the qlcolorcode-plugin since Highlight does not support Groovy.
Last tip: To find out which Quick Look generator is configured for a file type you can use the following command:
qlmanage -p Greet.groovy 2>&1 | grep 'Generator used'
I collected these infos mainly from here and here.
I definitely love Quick Look, and having it for groovy files is awesome! Thanks for the writeup. Let me know if you figure out how to get it working with a highlighter, added bonus!
ReplyDeleteThis is an awesome tip, thanks a lot!
ReplyDeleteHello,
ReplyDeletePlease add your site at http://www.sweebs.com. Sweebs.com is a place where other people can find you among the best sites on the internet!
Its just started and we are collecting the best found on the net! We will be delighted to have you in the sweebs listings.
Regards
Kris
I found out how to enable Quick Look with syntax highlighting for Groovy.
ReplyDeleteCheck out Quick Look for Groovy with Syntax Highlighting.