A tool to generate source code QuickLook previews for macOS Catalina and up

Latest Release: 1.1.0

 New Version

 

How to Use PreviewCode

Install the app and run it. This will register the availability of the app’s QuickLook extensions, Code Previewer and Code Thumbnailer. You can now quit the app — just click Quit:

The PreviewCode app UI

To use QuickLook in Finder, select a source code file and press space. This will pop up a rendered preview of the file, using a dark theme…

A dark-theme PreviewCode preview

…or a light theme…

A light-theme PreviewCode preview

…the choice is yours — make your selection in the main app’s Preferences panel.

Various PreviewCode themes

You’ll also get source code file previews in Finder’s preview pane, enabled using View > Show Preview or by hitting Cmd-Shift-P. PreviewCode enables syntax highlighted previews in the Preview: section of Finder’s file info panel (select a file and hit Cmd-I), too.

You can disable or re-enable Code Previewer and/or Code Thumbnailer in System Preferences > Extensions:

Control PreviewCode extensions in System Preferences, Extensions

For some background information on how macOS from Catalina and up delivers QuickLook previews, you might like to read this blog post.

Supported Languages and Data

  • ActionScript (.as)
  • Ada (.ads, .adb)
  • AppleScript (.applescript)
  • Arduino (.ino)
  • Basic (.bas)
  • Brainfuck (.b, .bf)
  • C (.c, .h)
  • C++ (.cpp, .hpp)
  • C# (.csx)
  • Clojure (.clj, .cljs, .cljc, .edn)
  • CoffeeScript (.coffee)
  • Dart (.dart)
  • Dylan (.dylan, .lid)
  • Elixir (.ex, .exs)
  • Erlang (.erl, .hrl)
  • Fortran (.for)
  • F# (.fs, .fsx, .fsi, .fsscript)
  • Go (.go)
  • Haskell (.hs, .lhs)
  • Java (.java)
  • JavaScript (.js)
  • Julia (.jl)
  • Kotlin (.kt, .kts, .ktm)
  • Lisp (.lisp, .lsp, .l, .cl, .fasl)
  • Lua (.lua)
  • Objective-C (.m)
  • Pascal (.pas)
  • Perl (.perl)
  • PHP (.php)
  • Python (.py)
  • Ruby (.rb)
  • Rust (.rs)
  • Swift (.swift)
  • TypeScript (.tsx)
  • Visual Basic Script (.vbs)
  • Bash (.sh)
  • C Shell (.csh)
  • Korn Shell (.ksh)
  • TCSH (.tsch)
  • Z Shell (.zsh)
  • ARM Assembler (.s)
  • x86-64 Assembler (.asm, .nasm)
  • CSS (.css)
  • LaTex (.tex)
  • Protobuf (.proto)
  • SASS/SCSS (.scss, .sass)
  • SQL script (.sql)
  • Twig (.twig)

Customise the Preview

Open the Preferences panel from the main app’s PreviewCode menu, by hitting Command-,, or by clicking the Show Preview Preferences button. This Preferences panel allows you to adjust some of the key elements of the preview:

  • The preview’s font — choose from any monospace font installed on your Mac.
  • The preview’s font style.
  • The preview’s text size, from 10pt to 28pt.
  • The preview theme.

Pick your theme from the list — click on a theme or its name to select it. Use the selector above the list to view only dark or light themes, or to view all of them:

The PreviewCode app preferences theme selection

Choose your preferred text size using the slider, then pick the monospace font you want the file to be presented in:

The PreviewYaml app preferences font selection

You can also choose each font’s style:

The PreviewYaml app preferences font style selection

Click Save to apply your choices.

Changing these settings will affect previews straight away.


Feedback and Bug Reports

You can use the main app to submit feedback. Just click in the Send Feedback button in the main app, or select Report a Bug… from its Help menu:

The PreviewCode app feedback mechanism

Please include your email address if you would like a response. I can’t respond without one. Please see the privacy policy for details of email address usage.


Troubleshooting

If it appears that either Code Previewer or Code Thumbnailer are not working after you have run the host app, please log out of your Mac and then log back in.


Enjoyed Using PreviewCode?

If you have found PreviewCode to be useful, please consider writing a positive review on the Mac App Store, or simply give it a rating.

Thank you!


Acknowledgements

PreviewCode makes use of code from the following sources:


Source Code

You can view PreviewCode’s source code at GitHub.


Release Notes

  • 1.1.0 28 July 2021
    • Improved font selection code.
    • Separate font style selection.
    • Accelerate loading of the Preferences panel, especially on Intel Macs.
    • Code streamlining.
    • Fixed a rare bug in the previewer error reporting code.
  • 1.0.0 17 June 2021
    • Initial public release.

Related Software


The Seal of RassilonThe Seal of Rassilon
Site and software copyright © 2021, Tony Smith