Syntax Highlighting In Quick Look
Press Space on a script and read it highlighted, with line numbers
Quick Look shows a Python, Go or shell script as plain text at best, or just an icon. spacebar takes Space for code and shows it highlighted, with line numbers, beside the folder. Spot a typo? Click and fix it.
Install It
Or paste this in Terminal
curl -fsSL https://spacebar.patebryant.com/install.sh | sh
The script downloads the latest notarized release from GitHub, checks its SHA-256 and installs to ~/Applications, no sudo. Read the script.
Press Space On A Script
- Select a source file, script or config in Finder.
- SpaceIt opens highlighted, the folder in the sidebar.
- ↑ ↓Click the next file, or move with the arrow keys.
What It Highlights
- Source codeJS, TypeScript, Python, Ruby, Go, Rust, Swift, C, Java, Kotlin, SQL and more
- Shellsh, bash, zsh and a
Makefile - ConfigYAML, TOML, XML, INI, plists; see JSON and YAML
Languages with no bundled grammar, such as Dart, Elixir, Haskell and Zig, show as plain text with line numbers, as do .ps1, .bat, .conf, .env, logs and dotfiles such as .gitignore. A Dockerfile, nginx configuration, Scala and Terraform are highlighted.
Over 2 MB, the first 2 MB. Scripts are never run; Open sends one to your editor, never Terminal.
Find, Copy And Fix A Line
- Fix in placeClick a line; it saves as you type. Not files over 2 MB, shell startup files, git hooks or LaunchAgents.
- ⌘F FindMatches highlighted, up to 10,000 counted.
- Copy⌘C copies the selection, or the whole file.
- RawXML, plists and minified CSS are laid out; Raw shows them as is.
- Diffs
.diffand.patch: added green, removed red. - Wrap LinesUnder Aa; off by default.
When Space Shows Something Else
- Another code previewer may claim the type; turn it off in System Settings (Help).
- macOS usually registers
.tsas video, which it keeps. Pick it from the folder’s sidebar.
Compared: Syntax Highlight, Glance, other apps. Files with no extension: after QLStephen. Every type: file types. PDFs and photos too: the Space helper, a Quick Look replacement.