Which languages get syntax colouring
Everything Note My colours, what colouring actually buys you in each case, and how to put any file into the language you want it in — in a single click, on your Mac.
"Supports 15 languages" tells you almost nothing. Colouring is the first layer, and most of these languages carry a second and a third on top of it: a signature panel while you are inside a function's brackets, and completions that write the import line in for you. This page is the coverage matrix: which languages Note My colours, what each one gets on top of colour, and how to put any file into the language you want it in.
Colour is never written into your file. Our syntax engine paints the window and nothing else, so choosing a language cannot mark the document as edited or change a byte of what you save. It happens on your Mac, with no account and no upload.
Fifteen code languages, plus a prose mode
Fifteen code languages get full colouring, and Plain Text sits alongside them as a deliberate prose mode for when you want the window quiet and macOS's own spelling and grammar underlines on instead. Every mode is one click away in the picker, and the one in use is named in the status bar, so you always know how the tab in front of you is being treated.
The fifteen are: Swift, Python, JavaScript, TypeScript, Java, C, C++, Ruby, HTML, CSS, PHP, Rust, Go, Kotlin and Shell.
The coverage matrix
Every one of the fifteen gets the same base: syntax colouring, keyword and built-in suggestions as you type, the declarations already written in your own file offered back to you in that list, and the marker the language actually uses when you comment a block out. The columns below are where some of them go further still.
| Language | Syntax colouring | Call tips | Import suggestions |
|---|---|---|---|
| Swift | Yes | Yes | Yes |
| Python | Yes | Yes | Yes |
| JavaScript | Yes | Yes | Yes |
| TypeScript | Yes | Yes | Yes |
| Java | Yes | Yes | — |
| C | Yes | Yes | — |
| C++ | Yes | Yes | — |
| Ruby | Yes | Yes | — |
| PHP | Yes | Yes | — |
| Rust | Yes | Yes | — |
| Go | Yes | Yes | — |
| Kotlin | Yes | Yes | — |
| HTML | Yes | — | — |
| CSS | Yes | — | — |
| Shell | Yes | — | — |
Call tips are the small panel that shows a function's signature while you are inside its brackets, with the argument you are currently typing highlighted. Ask for one with ⌃⇧Space and twelve of the fifteen answer, the table above showing which. It saves the trip to a browser tab for an argument order you half-remember.
Import suggestions offer you a symbol and the import line to add for it, written in for you when you accept. They cover four of the fifteen: Swift, Python, JavaScript and TypeScript. In the other eleven, completion offers keywords, built-ins, file paths from your disk and every name already used in your document, so the identifier you want is a keystroke away and the import line goes where your project keeps it.
Colour alone is enough for reading a file or fixing a typo. The last two columns are what matter if you live in one language all day.
What the colouring picks out
In all fifteen you get colour on keywords, types, built-ins, literals, numbers, strings, comments and function names, plus the details that make each language look like itself:
- HTML tags, CSS selectors, Ruby symbols,
$variablesin PHP and Shell, and Rust macros. - Multi-line strings — Python's
"""and''', and backtick templates in JavaScript and TypeScript — with${…}interpolation coloured as code again inside the string. - Regular-expression literals in JavaScript and TypeScript, which stay coloured as regular expressions rather than being mistaken for a division sign.
- Escape sequences painted over the string colour, and conventions that hold across languages: UpperCamelCase as a type, SCREAMING_SNAKE_CASE as a literal,
@attributes,#directivesand the C preprocessor.
One unbalanced quote colours the rest of its own line and stops there. The rest of the file keeps its ordinary colours, so a stray quote stays easy to spot instead of swallowing everything below it.
Language icons on every tab
Each tab carries a small language icon that keeps its own colour even when the tab is selected. With half a project open at once, the icons tell a Swift file from a stylesheet before you have read a single tab title. The status bar names the language of the tab you are in, and the Identify pill beside it is the one-click way to change it.
Beyond colour: re-indentation coverage
Our indentation engine takes all fifteen, so one command puts a badly formatted file back in shape and you can go straight back to reading it. Outside the fifteen, re-indenting still works on anything that marks its blocks with braces and brackets, so a file in an extension of your own comes back tidy too. The Indentation sheet's language picker offers a global default plus those fifteen, with two language locks: Go is set to tabs, on by default, and Python to four spaces, off by default.
There is one extra to reach for when you want it: Recover damaged comments, which splits a line back apart where a comment marker has swallowed real code. It covers thirteen of the languages and stays off until you switch it on, so nothing about your comments changes unless you ask, and documentation markers such as /// and /** are left exactly as written either way.
What every other kind of file gets
Beyond the colouring, the editor is language-agnostic, so whatever you open, the whole toolkit opens with it — and several of the file types you meet every day have something of their own waiting as well.
SQL
Start a query from the query.sql starter in our template library, and comment a clause out with SQL's own marker when you want it parked for a moment. A .sql file opens at once and edits comfortably: our find and replace with regular expressions, bookmarks in the gutter, Go to Line and the status-bar counters are all there while you work.
Markdown
Our template library ships Markdown starters for the files a project keeps asking for — README, CHANGELOG, CONTRIBUTING, SECURITY and issue templates among them — each ready to fill in. Our cleanup rules know Markdown too: trailing spaces stay exactly where you put them, because two spaces at the end of a line are a deliberate break there. That is the pattern throughout — your text is treated the way the file it lives in expects.
JSON, XML and YAML
JSON and XML carry structural commands of their own in the Edit menu: Format JSON, which re-indents to two spaces and sorts the keys; Minify JSON; Validate JSON, which reads the document and reports back without changing a character, naming (around line N, column M) when something is wrong; Format XML; and Minify XML. Each works on your selection if you have made one and on the whole document if you have not, and if a document will not parse, what you had is left untouched.
YAML is written by hand more often than it is generated, and that is the work this editor is shaped around. Type a key ending in a colon and the next line opens a level for you. The multi-line lists and mappings in a configuration file fold away on their brackets, so you can shut a block you have finished with and read what is around it. Indentation guides run down the page — on by default, with ten styles in Settings ▸ Guides — which makes a key that has drifted a level visible from across the room. And when a file that looks perfect refuses to parse, our hidden-character scanner is the thing to reach for: a non-breaking space sitting where a plain one belongs is named outright, with its line, its column and its code point, so you can put it right in seconds. Our template library gives you a data.json starter, a YAML starter and a GitHub Actions workflow saved as ci.yml to begin from.
Everything else
Any other file opens with the full editor around it: word and path completion, bookmarks, our find and replace with regular expressions, Go to Line, our cleanup rules, our hidden-character scanner, and encoding and line-ending conversion. Double-click an identifier and every occurrence lights up across the document; double-click a brace and the block folds away.
Log files get a treatment of their own. Turn on View ▸ Enable Log Highlighting and severity keywords, HTTP status codes, timestamps, IP addresses, UUIDs and URLs are picked out in colour, whichever language the tab is set to.
How to set the language for your file
Most files arrive already coloured. Our advanced language identifier sets the language the moment a file opens, so a Swift file is Swift, a shell script is Shell and a PHP template is PHP without you touching a menu. Files known by their name rather than by an extension are settled as they open too — CMakeLists.txt, Dockerfile, Makefile and a .env among them — each arriving in the mode that suits it, with nothing for you to choose first. It happens on your Mac: nothing about your file is uploaded, and there is no account involved.
A few files still open as Plain Text — a snippet with no extension, or an extension of your own. Nothing is ever painted as the wrong language, so the status bar is always telling you the truth about the tab in front of you, and one click puts an awkward file right.
Using the Identify pill
The status bar shows the language the current tab is using. Click the Identify pill and the Language Inspector opens. It names the language in use and offers a pop-up listing every mode: pick the right one and press Confirm, or press Cancel to leave things as they were.
The choice applies to that tab. The window repaints immediately and nothing asks you again for as long as the file is open, so an awkward file is set once and then forgotten.
Three files worth setting yourself
- CSS. Name a stylesheet with a
.cssextension and it is recognised on sight. If you keep your CSS in a file named something else, one pass through the Identify pill gives it selector, property and value colouring for as long as it is open. - Very short files. A snippet of a few lines with no extension opens in Plain Text, ready to type into straight away. Give it a language from the Identify pill when you want colour around it while you work.
- In-house extensions. An extension of your own that is really Shell or Python takes one pass through the Identify pill. Set it once and carry on with the file.
Colour in printouts and exports
Colour is not only for the screen. File ▸ Export As offers HTML with Syntax Highlighting…, RTF with Syntax Highlighting… and PDF…, and colouring survives in all three. The HTML is self-contained, with no size limit. Printing with ⌘P keeps colours too, with a print-friendly light theme on by default alongside line numbers, header, footer and wrapping.
Troubleshooting
Getting colour on a file that opened as Plain Text
Check the status bar first. If it says Plain Text — most often on a file with no extension, an unfamiliar one, or only a handful of lines in it — click the Identify pill, choose the language you want and press Confirm. Colour appears at once, and the tab keeps it for as long as the file is open.
Getting a stylesheet recognised as CSS
A stylesheet is recognised by its .css extension. Rename the file so it ends in .css, or set the language from the Identify pill when renaming is not an option — either route gives you selector, property and value colouring straight away.
I want the import line written in for me
Import suggestions come with Swift, Python, JavaScript and TypeScript: accept one for a symbol you have not imported yet and the import line is written in for you. In the other eleven, ⌃Space offers keywords, built-ins, paths and every name already in your document, and you place the import line where your project keeps it.
Getting suggestions in an HTML, CSS or Shell file
⌃Space opens the ordinary suggestion popup in all fifteen languages, HTML, CSS and Shell included, with tags, properties, built-ins and the names already in your document. The signature panel belongs to the twelve languages listed under Call tips in the table above.
Working in a very large file
A very large file behaves like any other: colouring stays on, and ⌃Space opens the suggestion popup exactly as it always does. Our large-file engine keeps typing responsive in very large documents, so you never trade colour for a file that opens.
The file is code but I want prose behaviour
Set the language to Plain Text. Colouring turns off and macOS's own spelling and grammar underlines turn on. No text-mutating assist is ever switched on in any mode — no auto-correct, no smart quotes, no dash substitution, no link or data detection — which is why a shell script that lands in Plain Text is never quietly damaged.
What you can count on in every language
- No language is fetched or updated over the network. Everything works offline, on your Mac, with no account, and your files never leave the machine.
- Colour is painted on the window only. Switching language leaves the bytes on disk exactly as they were and does not mark the document as unsaved, so you can try a language, look at it and change your mind.
- Completion knows what is in front of you. Suggestions come from the document you are editing, the paths on your disk and the built-in lists, so the names you are working with are offered first.
- HTML is coloured as source. Tags, attributes, strings and comments are picked out exactly as you wrote them, every character left where you typed it.
- Validate JSON is a read-only check. It tells you whether the document is valid and where the trouble is, and never rewrites a line to get there.
Frequently asked questions
How many languages are supported, exactly?
Fifteen code languages get full colouring, keyword and built-in suggestions, the declarations from your own file offered in that same list, and the comment marker the language expects when you comment a block out. Plain Text sits alongside them for prose. The full list is in the table above.
How do .sql files work?
A .sql file opens and edits comfortably. There is a query.sql starter in our template library, commenting a selection out uses SQL's own marker, and our find and replace, bookmarks, Go to Line and the status-bar counters all work as usual.
Can I set the language for a file myself?
Yes. Click the Identify pill in the status bar, choose the mode you want from the pop-up and press Confirm. The window repaints straight away, and the choice stays with that tab for as long as the file is open.
Which languages write the import line in for me?
Swift, Python, JavaScript and TypeScript. Accept a suggestion for a symbol you have not imported yet and the import line is added for you. The other eleven languages offer keywords, built-ins, paths and every name already used in your document.
Does choosing a language change my file?
Never. Switching language repaints the window and leaves the file on disk untouched. It does not even mark the document as unsaved, so you can try a language, look at the result and change your mind.
Will syntax colouring survive if I export or print the file?
Yes. Export as HTML, RTF or PDF keeps the colours, and printing does too, with a print-friendly light theme on by default. The HTML export is self-contained and has no size limit.