@@ -5,8 +5,8 @@ QLColorCode
55===============================================================================
66IMPORTANT NOTE FOR XCODE 3.2 (SHIPPED WITH SNOW LEOPARD) USERS:
77If you are running Xcode 3.2 or higher you will probably not see QLColorCode's
8- output. See here for details:
9- http://code.google.com/p/qlcolorcode/issues/detail?id=46
8+ output unless you disable Xcode's built-in source code qlgenerator.
9+ See the end of this file for details.
1010===============================================================================
1111
1212This is a Quick Look plugin that renders source code with syntax highlighting,
@@ -22,25 +22,23 @@ Setting the text encoding (default is UTF-8). Two settings are required. The
2222first sets Highlight's encoding, the second sets Webkit's:
2323 defaults write org.n8gray.QLColorCode textEncoding UTF-16
2424 defaults write org.n8gray.QLColorCode webkitTextEncoding UTF-16
25+
2526Setting the font:
2627 defaults write org.n8gray.QLColorCode font Monaco
28+
2729the font size:
2830 defaults write org.n8gray.QLColorCode fontSizePoints 9
29- the color style (see below):
31+
32+ the color style (see http://www.andre-simon.de/dokuwiki/doku.php?id=theme_examples
33+ or try slateGreen to see how I roll):
3034 defaults write org.n8gray.QLColorCode hlTheme ide-xcode
35+
3136any extra command-line flags for Highlight (see below):
3237 defaults write org.n8gray.QLColorCode extraHLFlags '-l -W'
38+
3339the maximum size (in bytes) for previewed files:
3440 defaults write org.n8gray.QLColorCode maxFileSize 1000000
3541
36- The following color styles are included with QLColorCode:
37- acid, bipolar, blacknblue, bright, contrast, darkblue,
38- darkness, desert, easter, emacs, golden, greenlcd, ide-anjuta,
39- ide-codewarrior, ide-devcpp, ide-eclipse, ide-kdev, ide-msvcpp, ide-xcode,
40- kwrite, lucretia, matlab, moe, navy, nedit, neon, night, orion, pablo,
41- peachpuff, print, rand01, seashell, slateGreen, the, typical, vampire,
42- vim-dark, vim, whitengrey, zellner
43-
4442Here are some useful 'highlight' command-line flags (from the man page):
4543 -F, --reformat=<style>
4644 reformat output in given style. <style>=[ansi, gnu, kr,
@@ -91,6 +89,45 @@ As an aside, by changing colorize.sh you can use this plugin to render any file
9189type that you can convert to HTML. Have fun, and let me know if you do anything
9290cool!
9391
92+ ====================================================================
93+ Important information on using QLColorCode with Xcode v3.2 and later
94+ ====================================================================
95+
96+ The most up-to-date copy of this info will be found here:
97+ http://code.google.com/p/qlcolorcode/wiki/ImportantNoteForXcodeUsers
98+
99+ Xcode 3.2 (the version shipped with Snow Leopard) includes a Quick Look plugin
100+ that highlights source code. It only highlights a few languages, so you probably
101+ still want to use QLColorCode. However, the Quick Look server tends to pick the
102+ Xcode plugin over QLCC. This means that for any source code file aside from .c,
103+ .m, and the other languages that Xcode understands you'll see a plain text
104+ preview with no highlighting. To get QLCC to work properly you'll need to
105+ disable the Xcode plugin.
106+
107+ Details
108+ -------
109+
110+ The Xcode plugin is installed at:
111+
112+ /Developer/Applications/Xcode.app/Contents/Library/QuickLook/SourceCode.qlgenerator
113+ The simplest way to disable it is to open Terminal.app and run these commands:
114+
115+ f=/Developer/Applications/Xcode.app/Contents/Library/QuickLook/SourceCode.qlgenerator
116+ sudo mv $f $f.disabled
117+
118+ This will rename the plugin to SourceCode.qlgenerator.disabled, which will
119+ prevent it from being loaded by quicklookd.
120+
121+ A Note on Code Signing
122+ ----------------------
123+
124+ The Xcode application is cryptographically signed. Disabling the
125+ SourceCode.qlgenerator plugin will NOT invalidate the signature. You can
126+ confirm this by using the codesign command after disabling the plugin:
127+
128+ [n8gray@golux]% codesign -vv /Developer/Applications/Xcode.app
129+ /Developer/Applications/Xcode.app: valid on disk
130+ /Developer/Applications/Xcode.app: satisfies its Designated Requirement
94131
95132Cheers,
96133-n8
0 commit comments