Skip to content

Very fast macOS extension for coloring code, supports every (60+) uti types. Might be the fastest implementation, and different because 100% Swift: no rtf nor html.

Notifications You must be signed in to change notification settings

Oil3/CodeColors-Quicklook-Syntax-Highlighting

Repository files navigation

Code Colors

Code Colors - Quicklook Preview is a free, very fast Quicklook Extension for macOS.
It is different than others because it uses new SwiftUI Text capabilities: no html, no rtf, no js.
Very fast as in breaks the sound barrier: it's opened before the sound of your spacebar/click ends. *

Features

  • Any File Types: More than 60 extensions, such as .swift, .py, .yaml, .xml, .json, .c, .h, .mm, .1, .gradle... etc, as well as files without extension. But not Markdown. Info.plit full list.

  • Syntax Highlighting: Still basic.

  • Lazy Loading: Loads lines per 96KB chunks for immediate viewing, stops when view disappears.

  • Pure Swift: 100% Swift with only the code that is necessary: the minimum and nothing external.

  • Main-Thread Offloading: All file loading and processing are done off the main thread, safeguarding against system freezes.

  • As safe as your file: Sandboxed, hardened, notarized, doesn't require internet or any permission whatsoever, doesn't run the files, but applies formatting on strings that match a pattern.

  • No File Associations: Doesn't replace the default app for opening files, doesn't interfere with workflow.

Download from Releases or from the repository

Direct download latest Universal binary (Silicon and Intel).

Install

Launch the app once. This registers the extension as the extension itself stays within the app bundle.

Uninstall

Delete the app.

Update

Replace the older app with the newer app. MacOS looks for the extension in the app: if app is moved, a relaunch might be needed.

ss1_lanczos

Issues/todo:

The first priority was to handle a test file with 23millions characters in 200thousands lines, with immediate render, no freeze and a quick memory release.
Now the needs are:

  • Implementing the logic for customizing the colors which is God willing for next update; right now these are just my colors.
  • Fixing an issue where a negative number doesn't have its - sign colored.
  • import profiles
  • Markdown is not in the list to not interfere until we have the settings to choose which extension to ignore.

Sound-on truth of breaking the sound barrier

Screen.Recording.2025-02-21.at.7.57.07.P720M.1.webm

a mac is a mac and it needs to stay comfortable.

About

Very fast macOS extension for coloring code, supports every (60+) uti types. Might be the fastest implementation, and different because 100% Swift: no rtf nor html.

Topics

Resources

Stars

Watchers

Forks

Languages