Quick Look extension for highlighting source code files
open sourceGPL-3.0free
Syntax Highlight is a Quick Look extension for macOS that previews source code files with syntax highlighting when you press space in Finder, using André Simon's Highlight engine. It covers most programming languages and config, markup and data formats such as JSON, YAML, XML and plist, shows extensionless text files, images and hex dumps of binaries, and renders as RTF or HTML. A settings app chooses colour schemes for light and dark mode (with an editor for copies), fonts, word wrap, line numbers, tab width and git or Mercurial change markers, globally or per format, and a syntax_highlight_cli tool converts files in batches. It needs macOS 12 or later, is a signed universal binary installable with Homebrew, and is GPL-3.0 licensed.
Problems it solves
- pressing space on a code file in Finder shows plain text with no colours
- preview Python, Rust or shell scripts in Quick Look with syntax highlighting
- glance at a YAML or plist config in Finder without opening an editor
- Quick Look shows nothing useful for files with no extension
- see line numbers and git changes when previewing a source file in Finder
- match my Quick Look code previews to dark mode
Features
- syntax-highlighted Quick Look previews for most programming languages
- JSON, YAML, XML, plist and other config and data formats
- extensionless text files, images and hex dumps
- RTF or HTML output with custom CSS
- colour schemes for light and dark mode with a theme editor
- font, word wrap, line numbers, tab width and data limit settings
- git and Mercurial change highlighting
- per-format preprocessors and language servers
- syntax_highlight_cli for batch conversion
- signed, notarized universal binary
Limitations
- Can't preview some extensions macOS reserves for itself: .ts, .mts and .dart, and .json on macOS 13 with Apple silicon1
- Doesn't generate Finder icon thumbnails1
- Doesn't preview Markdown: the author points to QLMarkdown1
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what Syntax Highlight does.
- Glance A self-hosted dashboard that puts all your feeds in one place
- QLMarkdown A macOS Quick Look extension that previews Markdown files, with GitHub Flavored Markdown, maths and Mermaid diagrams.