How can I activate the text preview in Finder's column view for an arbitrary filetype or document type

I really like the preview functionality that Finder offers in the last column of the column view. However, not all filetypes or document types are associated with a preview.

For example when I have a file INSTALL (without file extension), the document type of this file is just Document and the preview column only contains an icon.

How do I change the behavior of Finder in such a way that a text preview is displayed for the file INSTALL?


Solution 1:

Column previews in Finder are in fact provided by QuickLook, not Preview – as are the icons displaying the file contents, the CoverFlow icons and the QuickLook preview proper you invoke by pressing Space or Cmd+Y on a selected file.

QuickLook uses plugins to display file contents – a piece of code rendering the file contents and telling the QuickLook server it can do so (see the QuickLook Programming Guide if you want the technical details). You need plugins because files can be binary data – without knowledge of its structure, no representation of the file is possible – or textual data that needs processing – HTML for instance, which you’ll probably prefer to preview rendered, not as raw source. They also must be limited to specific, known file types (to be precise: Uniform Type Identifiers, or UTIs for short) for this exact reason – a rendering plugin for HTML will not give you a usable preview for a JPEG. OS X provides quite an impressive default collection of these plugins (located in /System/Library/QuickLook), and applications you install add their own (located in the application package itself, /Library/QuickLook or ~/Library/QuickLook). You can also add some yourself to those two last locations.

In the case of text files without an extension, the problem is OS X’s built-in plain-text QuickLook plugin is not assigned to these as they do not correspond to a UTI it handles. However, there is a 3rd party QuickLook plugin adding that functionality: QLStephen. Just download it and install it according to its installation instructions on GitHub and you should be good to go.