SourceCodeSyntaxHighlight
Quick Look extension for highlight source code files on macOS 10.15 and later.
Install / Use
/learn @sbarex/SourceCodeSyntaxHighlightREADME
Syntax Highlight
The application offers a Quick Look Extension for macOS 10.15 Catalina and later for previewing source files. Inside it uses Highlight to render source code with syntax highlighting.
Syntax Highlightis distributed in the hope that it will be useful but WITHOUT ANY WARRANTY.
If you like this application and find it useful, buy me a coffee!
- Installation
- Enable the Quick Look extension
- File format management
- Application settings
- Command line interface
- Add support to a custom format
- FAQ
- Known bugs
- Note for developers
- Credits
Installation
You can install the application in various ways. When the main application is launched it automatically checks for updates.
After installation, the application must be launched at least once to allow the system to detect the Quick Look extension. See below for instructions on how to enable the Quick Look extension.
Download precompiled release
Head over to the releases page to view the latest version. Move Syntax Highlight.app into the Applications folder.
Install with Homebrew
Syntax Highlight can also be installed via Homebrew. If you have not installed Homebrew, follow the simple instructions here. After that, install the current version of Syntax Highlight with the following command:
brew install --no-quarantine syntax-highlight
Note for the precompiled release
The precompiled app is not notarized or signed, so the first time you run the app the system may show a warning about the impossibility to check for malicious software.
To fix, you can launch the app with right-click (or Control-click) on the app icon and choose the open action.
You can also execute this command from the terminal:
xattr -r -d com.apple.quarantine "FULL PATH OF Syntax Highlight.app (you can drag the file to get the pull path)"
Alternatively, after trying to launch the app for the first time, you can open the System Preferences > Security & Privacy > General (tab) and click the Open Anyway button.
This will resolve the error of an unsigned application when launching the app.
Build from source
The release application is compiled as a universal binary (Intel and Apple silicon processor).
After cloning remember to fetch submodules:
git submodule init
git submodule update
Enable the Quick Look extension
To use the Quick Look preview you must launch the Application at least once. In this way the Quick Look Extension will be discovered by the system and will be available in the System preferences > Extensions > Quick Look.

When opening the app for the first time, you may see a pop-up warning about unable to check malicious software.
To fix follow these steps:
- Switch to Finder and navigate to the application.
- Right-click (or Control-click)
Syntax Highlight.appand choose theOpenitem from the contextual menu. - A modal popup appears stating:
"Syntax Highlight.app" can’t be opened because Apple cannot check it for malicious software.
- Click
Opento confirm.
This warning is because the app is neither codesigned nor notarized.
For more info see the note for the precompiled release.
File format management
The Quick Look Extension uses the Uniform Type Identifier (UTI) to handle the supported formats (and not simply the file name extension). Inside the definition on an UTI there are the list of extensions and mime type associated with it.
Some file types are directly associated to a UTI by the system. Other formats are registered by the owner application. In this way some extensions can be associated to multiple UTIs based on the applications currently installed. For this reason, this application supports many UTIs even if they are apparently redundant.
MacOS 10.15 Catalina does not allow to manage some file formats including (but not limited to): .xml, .plist, .html, .ts, .dart, .txt, common images (.jpg, .gif, .png), …
On macOS 11 Big Sur, the system allows you to manage these previously unauthorized extensions: .plist.
On macOS 12 Monterey, the system allows you to manage these previously unauthorized extensions: .xml.
Supported formats
Most programming languages are supported. The application can also handle some plain files without extension.
- Ada (
.ada) - Adobe Acrobat Sequence files (
.sequ) asXML - Adobe Flash ActionScript source files (
.as) - Adobe Flex files (
.mxml) files asXML - Adobe JSX script files (
.jsx) - Adobe UPX Javascript (
.psjs) - Apple loctable (
.loctable) asplist (XML) - Apple workflow (
.wflow) asplist (XML) - AppleScript (
.scpt,.applescript,.ascr) automatically decompiled withosadecompile - Apple shell script files (
.command) - Assembler source files (
.asm,.s79) - Astro files (
.astro) asJSX. - Autolit files (
.au3,.a3x) - Azkaban flow files (
.flow) asYAML - ATL files (
.atl) - (G)AWK files (
.awk) - Bash Script files (
.bash) - Bezel (
.bezel) as plain text - BibTex (
.bib) - C shell script files (
.csh) - C source files (
.c,.h) - C# source files (
.cs) - C++ source files (
.cpp,.cp,.c++,.cc,.cxx,.hpp,.hh,.hxx,.ipp) - ClojureScript (
.cli,.cljs,.cljc,.edn) - CMake files (
.cmake) - CocoaPod files (
.podspec) asRuby - CoffeeScript source files (
.coffee) - ColdFusion files (
.cfc,.cfm,.cfml) - Configuration files (
.conf) - Configuration profiles (
.mobileconfig) asXML - Crystal language (
.cr) - CSON source files (
.cson) - CSS files (
.css) - Cuda files (
.cu) asC++ - D (
.d) - Dart source files (
.dart).dartis reserved by macOS and cannot be handled. - Designspace files (
.designspace) asXML - Diff files (
.diff,.patch) - Dockerfile (
.dockerfile) - Document Type Definition (
.dtd) - DOS batch files (
.bat,.cmd) - Dylang (
.dylan) - ECore files (
.ecore) - Eiffel project files (
.ecf) asXML - Eiffel source files (
.e,.ex,.exs) - Elixir files (
.ex,.exs,.heex) - ePub Navigation Center eXtended (
.ncx) as XML. - ePub Open Packaging Format (
.opf) files as XML. - Erlang source files (
.erl,.hri) - F# source files (
.fsx,.fs) - fish source files (
.fish) - FonTool files (
.ttx) asXML. - Fortran source files (
.f,.for,.f90,.f95) - GCC linked files (
.ld,.map,.d) - Gdscript (Godot engine) (
.gd). - Gleam (
.gleam) - Golang source files (
.go) - Google Earth KML Document files (
.kml) asXML - Gradle source files (
.gradle) - Graphics Language Transmission Format (
.gltf) asJSON - Groovy source files (
.groovy) - Haskell source files (
.hs,.lhs) - HTML Abstraction Markup Language (
.haml) - IDL source files (
.pro) - INF files (
.inf) - INI configuration files (
.ini,.cfg) - Inno source files (
.iss) - INO source files (
.ino) - IntelliJ IDEA module (
.iml) - Interface Builder Storyboard (
.storybard) asXML - Interface Builder XIB (
.xib) asXML - Java Compiled Class (
.class) requirejavapto decompile - Java Properties files (
.properties) asINI - Java Server Page files (
.jsp) - Java source code (
.java,.jav) - Java Web Start (
.jnlp) - JavaFX ML (
.fxml) - JavaScript files (
.js,.jscript,.javascript,.mjs,.jsm) - JSON files (
.json,.jsonc,.json5) ** On macOS 13 Ventura with Apple Silicon the.jsonextension is reserved by the system and cannot be handled.** - JSON Canvas (
.canvas) asJSON - JSON Line files (
.jsonl) asJSON - Julia source files (
.jl) - Jupyter N
