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:
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…
…or a light theme…
…the choice is yours — make your selection in the main app’s Preferences panel.
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:
.actionscript
).ads
, .adb
).applescript
).arduino
, .ino
).basic
, .bas
).brainfuck
, .b
, .bf
).c
, .h
).cpp
, .hpp
).csx
, .cs
, .c-sharp
, .csharp
).clojure
, .clj
, .cljc
, .cljs
).coffee
, .coffeescript
, .litcoffee
).dart
).elxir
, .ex
, .exs
).elm
).erlang
, .erl
, .hrl
).for
).fsharp
, .f-sharp
, .fsi
, .fsx
, .fsscript
).go
).gml
).haskell
, .hs
, .lhs
).java
).js
).julia
, .jl
).kotlin
, .kt
, .ktm
, .kts
).lisp
, .lsp
, .fasl
).lua
).m
).pas
).perl
).php
).py
).rb
).rs
, .rust
).swift
).typescript
, .tsx
).vbscript
, .vbe
, .vbs
, .wsc
, .wsf
).vue
).sh
).csh
).ksh
).tsch
).zsh
).s
).asm
, .nasm
).plist
).entitlements
).xib
).storyboard
).asciidoc
, .adoc
, .asc
).conf
, .cf
, .cfg
, .ini
, .rc
).cmake
).css
).env
).latex
, .tex
)makefile
).proto
).scss
, .sass
).sql
).tf
, .terraform
).tfvars
).twig
)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:
PreviewCode allows you to choose a light theme, a dark theme, or one of each and use macOS’ current UI mode to apply one of them appropriately. Check the Theme Mode option you prefer, and then select your theme(s) from the list.
For example, to always show code in a light theme, whatever mode your Mac’s UI is set to, check Light and then select a light theme:
Alternatively, to always show code in a dark theme, no matter what mode your Mac’s UI is set to, check Dark and then select a dark theme:
In each of these cases, PreviewCode will only show themes of the selected type. However, if you check Auto, you will be able to select one light theme and one dark theme from a list of all themes. PreviewCode will then apply the theme that matches your Mac’s current UI mode:
Your Mac may be set to light mode or dark mode, or to automatically change according to the time of day. You make this choice in System Settings > Appearance.
Click Save to apply your choices.
Changing these settings will affect previews straight away.
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:
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.
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.
.edn
files. This is because the .edn
file extension is pre-set on macOS to an Adobe digital rights management product..ts
files. This is because the .ts
file extension is pre-set on macOS to MPEG-2 transport stream video files. It does support the .tsx
and .typescript
extensions..exs
files if GarageBand and/or Logic Pro is installed on your Mac. This is because these apps use this file extension for EXS24 instrument files.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!
PreviewCode makes use of code from the following sources:
You can view PreviewCode’s source code at GitHub.
com.microsoft.typescript
UTI..elm
Elm files..scpt
binary AppleScript files..gml
GML (GameMaker Language) files..vue
Vue.js files..entitlements
, .xib
, .storyboard
Xcode files.com.microsoft.c-sharp
UTI..plist
).public.lua-script
UTI..cs
C# extension..env
files..cmake
files..tfvars
files..adoc
, .asciidoc
and .asc
files..conf
, .cf
, .cfg
, .ini
and .rc
config files.hsl
extension..nasm
preview..actionscript
to avoid clash with AppleSingle .as
..cl
— clash with OpenCL source..l
— clash with Lex source..fs
— clash with OpenGL Fragment Shader source..dylan
and .lid
extensions..tf
files.