I have a lot of files that contains data in plain text format with different extensions -- things like .cfg, .dat and .tex. However, those files are not recognized by the Quick Look viewer. It is possible to make these other files visible with the default Quick Look viewers by simply adding a UTI (Uniform Type Identifiers) file reference to an application's Info.plist file.
For example, TeXShop is an application that writes Latex files in plain-text with the .tex extension. If you want to see these .tex files with Quick Look, conrol-click on TexShop.app in the Finder and chose Show Package Contents from the pop-up menu. Navigate into Contents, then open Info.plist with TextEdit and add the public.plain-text string to the UTTypeConformsTo key as follows:
First look for the UTExportedTypeDeclarations section in the original file:
Now add the public.plain-text string to the UTTypeConformsTo key:
To make the changes take effect, the UTI reference must be exported again. One way to do this is to try moving the application to another folder and then putting it back in its original location and opening it. However, it may be that a logout is required. Now you should see .tex, .latex, .itx, .texi and .ctx as plain-text in Quick Look. This trick can be extended to other applications by adding the public.plain-text or public.movie (for files that QuickTime can open) string to the UTTypeConformsTo key.
... <key>UTExportedTypeDeclarations</key> <array> <dict> <key>UTTypeConformsTo</key> <array> <string>public.text</string> <string>public.plain-text</string> </array> <key>UTTypeDescription</key> <string>TeX text file</string> <key>UTTypeIdentifier</key> <string>org.tug.tex</string> etc...
Mac OS X Hints