Editing text and code on a Mac
Practical answers to the things people actually need to do with text on a Mac — each one written against the shipping app and tested end to end.
Start Here
How to use a text editor on Mac
The first ten minutes: what the welcome screen offers, how to open and save a file, how tabs behave, and what is already protecting your work.
Mac text editor keyboard shortcuts
The full list, grouped by menu — plus the keys that work in context, the pointing gestures worth learning, and the two combinations to know well.
The Note My toolbar, button by button
Nineteen icon-only controls in eleven glass capsules — what each one does for you, which four show you their state, and the quickest route to each.
Big Files & Logs
How to open a large text file on Mac
Multi-megabyte logs and dumps, open and editable — plus how to follow, search and tidy one up once it is on screen.
How to tail a log file on Mac
Pin the editor to the end of a file another process is still writing, and watch new lines arrive without reopening anything.
How to find errors in a log file on Mac
Jump between failures in a long log with a keystroke, find the ones spelled differently with a regular expression, and count exactly how many there are.
How to view a log file on a Mac
Open a log file and switch on colouring that picks out severities, HTTP status codes, timestamps and addresses from the grey.
How to count lines in a file on Mac
Lines, characters, words and spaces live in the status bar — plus how to count occurrences of a word, search matches, and matches across a folder.
How to paste a large amount of text on Mac
Megabyte-scale pastes stay responsive and stay stoppable — plus what happens to the formatting, the language and the hidden characters that came with them.
Writing Code
How to view code syntax on a Mac
Open a source file on a Mac and read it in colour straight away — what each colour marks, which languages are covered, and how to keep the colours when you print.
Syntax highlighting not working on Mac
A file opened as flat, uncoloured text — here is what the status bar is telling you, what the language setting controls, and how to set it yourself.
How to change a file's syntax language on Mac
Override the language on any file, or set one on a brand-new document, using the Identify pill and the Language Inspector.
Which languages get syntax colouring
The fifteen code languages that get syntax colouring, what each one gets beyond colour, and how to put any file into the right language yourself.
How to get code completion on Mac
Suggestions as you type, or on demand with a keystroke — how to open the list, how to accept a row, and what to do when nothing appears.
How to see function parameters while typing on Mac
A call tip shows the signature with the argument you are on picked out — how one arrives while you type, and how to call it up whenever you want it.
How to autocomplete file paths on Mac
Let the editor finish the long project paths you keep retyping into config files and scripts, and memorise the ones you reuse everywhere.
How to turn off code autocomplete on Mac
Switch the suggestion popup off, or keep the useful half of it — every switch, what you keep afterwards, and how to clear what the editor has learned.
How to collapse code blocks on Mac
Double-click a brace and everything between it and its partner folds away — plus the three ways to bring it back, and how to read a file by its shape.
How to highlight all occurrences of a word on Mac
Double-click an identifier and every other use of it in the file lights up — whole words only, in any script, and never written into your document.
How to edit a Python file on a Mac
Open a .py file in a native Mac editor with Python colouring, suggestions that carry their own import line, and call tips while you write.
How to open a Swift file on a Mac
Read and edit a .swift file in a light editor — colouring, completion that brings the import line with it, call tips and folding, with no project to set up.
How to edit a JavaScript file on Mac
What a native Mac editor gives you on a .js file — colouring that holds template literals together, six kinds of suggestion in one list, auto-import and call tips.
Formatting & Indentation
How to re-indent code on Mac
Put a whole source file back at the right depths in one pass — where the Indentation sheet lives, what Apply changes, and how to tune it for your language.
How to fix pasted code formatting on Mac
Code that arrived as one run-together line, put back into readable blocks — statements split apart, depth restored, and the invisible junk cleared out.
How to change tab size and indent width on Mac
Set the indent width, choose tabs or spaces per language, and match any project's house style in a couple of clicks.
How to auto-indent code on Mac
Make Return carry your indentation down and open a new level inside a block — and keep exactly the parts of smart typing that suit the way you write.
How to auto-close brackets and quotes on Mac
The six pairs that close themselves as you type, how to step over a closer instead of doubling it, and how to switch any of it off.
How to auto-close HTML tags on Mac
Type the closing angle bracket and the matching closing tag appears — where the switches live, how void elements come out, and how to set a file to HTML.
How to fix mixed tabs and spaces on Mac
See exactly which lines mix tab and space characters in their indentation, get a list of every one of them, then re-indent the file to one consistent unit.
How to show indentation guides on Mac
Vertical markers down every level of nesting, in any of ten styles — where the toggle lives, which style to pick, and why your file stays exactly as you wrote it.
Formatting by Language
How to indent Swift code on Mac
Re-indent a whole Swift file in one pass, set the brace style and width once, and see exactly which Swift settings stick.
Fix Python indentation on a Mac
Set Python to four spaces, see the tabs hiding in the file, and re-indent the whole document in one pass from the toolbar Indent button.
How to format JavaScript code on Mac
Re-indent a JavaScript file in one pass — brace style, indent width, trailing commas and semicolons — and unpack the statements that share a line.
How to indent Java code on Mac
Re-indent a whole .java file in one pass, and set the three things Java arguments are actually about: brace placement, case labels and annotations.
How to indent C and C++ code on Mac
Which control re-indents a C or C++ file on a Mac, what each of the C and C++ options actually changes, and how to make a whole file agree in one pass.
How to indent Go code on Mac
Go is the one language Note My locks to hard tabs, and the lock is on by default — here is what the re-indent pass changes and what it leaves alone.
How to indent Rust code on Mac
Four-space blocks, same-line braces and trailing commas on match arms — what one re-indent pass changes in a .rs file, and what it keeps exactly as you wrote it.
How to indent PHP code on Mac
Re-indent a PHP file to your house brace style in one pass, with every heredoc left exactly as you wrote it and four-space PSR-12 spacing straight out of the box.
How to indent Ruby code on Mac
Ruby is written in two spaces and the editor defaults to four — here is where to change that, plus the block-style and hash-rocket controls the sheet adds for Ruby.
How to format a bash script on Mac
Re-indent bash, sh and zsh consistently, keep heredoc bodies untouched, and find the invisible characters that stop a correct-looking script from running.
How to format CSS code on Mac
Re-indent a stylesheet with the brace style and width you want, and set the language yourself on the days a CSS file opens as plain text.
How to format HTML code on Mac
Re-indent a collapsed or ragged HTML file in one pass, keep pre blocks exactly as written, and format the script and style content inside the page.
Cleaning Text
How to remove invisible characters on Mac
Find every hidden character in a file, see the line, column and code point of each one, and delete the ones that are safe to delete without touching a visible word.
How to remove zero-width spaces on Mac
Find every zero-width space, joiner and word joiner in a file, see exactly where each one sits, and remove the lot in a single undoable pass.
How to remove hidden characters from AI text on Mac
One command strips the invisible markers that travel with text pasted out of an AI chat, without rewriting a single word, dash or emoji.
Convert smart quotes to straight quotes on Mac
Curly quotes, en and em dashes and the ellipsis character, found and flattened to plain ASCII — with every match listed for you before a single one changes.
How to remove non-breaking spaces on Mac
Find every non-breaking, narrow, ideographic and unusual Unicode space in a file and turn it into an ordinary space, in one pass you can undo.
How to show invisible characters on Mac
Draw spaces, tabs and line endings on screen so you can see what is actually in the file — without changing a single byte of it.
How to remove trailing whitespace on Mac
Show the spaces and tabs sitting at the ends of your lines, then strip them in one undoable pass — with the two places your text is protected on purpose.
How to remove control characters on Mac
Strip NUL bytes, escape codes and other non-printable control characters out of a log or export, without disturbing the tabs and line breaks you need.
How to find homoglyph characters on Mac
Locate the Cyrillic and Greek letters standing in for Latin ones in an identifier, read the exact code point of each, and correct them without a blind search and replace.
How to find bidi control characters on Mac
Direction-control code points can make a line of source read one way and compile another — here is how to scan a file for them, see each one, and take them out.
How to clean text copied from a PDF on a Mac
Soft hyphens, no-break spaces and stray line breaks come across with the words — here is how to find them, remove them, and leave the wording alone.
Custom text cleanup rules on Mac
Write your own regex cleanup rules, count their matches before you run them, sweep a document in one undoable pass, and export the set as JSON.
How to fix decomposed accents on a Mac
Two words that look identical but never compare equal, explained — how to see whether an accent is composed or decomposed, and how to normalise it.
Finding & Comparing
How to find and replace text on Mac
Swap one string for another in the file you are looking at — where the controls are, what each of the seven buttons does, and what the beep means.
Regex find and replace on Mac
The syntax you can type, capture groups and the $1 replacement template, what the three checkboxes change about a search, and how to scope a sweep safely.
How to search for text in files on Mac
Search every text file under a folder for a string, read the matches grouped by file, and open any one of them at the line it was found on.
How to replace text in all open tabs on Mac
One action that rewrites the same string in every document you have open — with the live match count in front of you first, and the whole sweep paced so you can watch it land.
How to compare two files on a Mac
Put two documents side by side, see every differing line and character marked in the text itself, and leave the comparison with one key.
Delete or copy every line containing a word
Mark every line that matches a word or a pattern, then lift those lines out to the clipboard or delete them in one move — without leaving the editor.
How to go to a line number on Mac
A compiler, a linter or a stack trace hands you a line number — here is how to land on that line, and how to find the number when nothing has told you.
How to bookmark lines in a text file on Mac
Mark the lines you care about, step between them with two keys, and act on the whole set at once — without scrolling or running the same search again.
How to record a macro in a text editor on Mac
Have the editor watch you make a repetitive edit once, then replay it across a line, a whole file or every open tab — and undo the lot in one step.
How to repeat the same edit many times on Mac
Record an edit once, then replay it up to 9,999 times across one tab or every open tab — with a confirmation, a cancel key and a single undo.
Files, Encodings & Formats
How to fix garbled characters in a text file on Mac
A file full of Ã, Â or question marks is almost never damaged — it is being read with the wrong encoding, and re-reading it is one menu away.
How to convert a file to UTF-8 on Mac
Re-encode a file that reads correctly but is stored wrong — and the one distinction, convert versus reload, that decides which command you need.
How to convert CRLF to LF on Mac
See whether a file holds LF, CRLF, CR or a mixture of two, convert the whole document in one step, and control what gets written the next time you save.
How to remove a byte order mark on Mac
A leading byte order mark breaks scripts and parsers, and a stray one mid-file is worse. How to see U+FEFF, remove it, and save the file without one.
How to format JSON on a Mac
Turn a squashed one-line JSON blob into two-space indented, readable text — on your own Mac, with the one behaviour you should know about first.
Validate JSON and find the syntax error on Mac
Get the line and column that broke a JSON file, on your own Mac, without pasting your configuration into a web form.
How to format XML on a Mac
Pretty-print an unreadable XML document or collapse it back down, in two Edit-menu commands that leave the file alone when the markup is broken.
How to open any file as text on Mac
Force open a file macOS will not hand to a text editor — no extension, an unfamiliar one, or a type the system calls binary — and read what is inside it.
How to open and edit a CSV file on Mac
Open a CSV in Note My and see exactly what is in the file — no reformatted dates, no dropped leading zeros, and no size at which it stops opening.
How to create a file from a template on Mac
Forty built-in starter files — READMEs, licences, configs and language starters — with the year, your name and the project name already filled in for you.
How to save your own file template on Mac
Turn the document you keep retyping into a reusable starting point, with tokens that fill in the date, the year and your name for you.
How to create a README file on Mac
Start a README, a licence, a CHANGELOG or a .gitignore from a ready-made template, with the year and your name already filled in.
How to insert the date automatically on Mac
Drop today's date, the filename, your name or a fresh UUID into a file from a menu instead of typing it, using the editor's fourteen smart tokens.
Recovery & Sessions
How to recover an unsaved file on Mac
What actually survives a crash or a force quit, how your tabs come back at the next launch, and what to check the moment they do.
How to close a tab without losing work on Mac
What is still recoverable after you close a tab — including the five seconds you get back after clicking Don't Save, and what that Restore button really returns.
What autosave protects on a Mac
What is protecting your typing before you press Save, what the star on a tab is telling you, why it is always on, and how your session comes back after an unexpected quit.
How to restore your previous session on Mac
What comes back when you relaunch — the tabs, their order, the selected one and the text you never saved — and how to pick up exactly where you were.
What to do when a file changes on disk on Mac
A sheet says the file changed underneath you and offers two buttons — here is exactly what Reload and Keep My Version each do to your work.
How to auto-reload a file when it changes on Mac
Ask, Auto-Reload or Never — where the switches live, why logs refresh themselves, and the one conflict that always stops to ask you first.
What to do when a file is deleted while open on Mac
The file under an open tab has gone — trashed, moved, or wiped by a checkout. What the editor asks you, and how to get your text back onto disk.
What the asterisk on a file tab means
The leading star means unsaved text; the orange dot means the file changed on disk — two markers with two different answers before you close a tab.
Working on a Mac
How to open a file from the Finder on Mac
Every route from a Finder selection into the editor — the right-click submenu, the Services menu, a drag onto the tab bar — without an Open dialog.
Finder extension not showing on Mac
The right-click submenu waits until macOS says otherwise — how to switch it on, everything it adds, and how to make it your quickest route into a file.
How to copy a file path on Mac
Get a path, a relative path, a folder path, a filename or a file's whole text onto the clipboard — from the Finder's right-click menu or from the editor.
How to copy code as a Markdown code block on Mac
Right-click a file in the Finder and put its contents on the clipboard already fenced — with the file's path above it, if the person reading needs to know where it came from.
How to create a new file in a folder on Mac
Right-click inside a folder and get a real file there — empty, from a template, or from the clipboard — without opening the Terminal first.
How to open a file from Terminal on a Mac
The open command, the notemy:// scheme and its three verbs — every supported way to hand a file to the editor from a shell script or a build step.
How to rename an open file on Mac
Two rename commands with similar names and different jobs — which one touches the disk, which one can move the file, and what each does with unsaved edits.
How to save a copy of a file on Mac
Duplicate a tab, duplicate the file on disk, or write a copy and carry on in the original — and which save command quietly moves you onto the new file.
How to open multiple files in tabs on Mac
Open a working set of files at once, drag them in from the Finder, pin the ones you cannot afford to lose, and read every marker on the tab bar.
How to view two files side by side on Mac
One pane per open tab, in one window — how to set it up, how to rearrange the panes, and when you want Compare instead.
How to close all tabs at once on Mac
Five ways to clear a window full of tabs — including the one that asks a single question instead of one question per unsaved file.
How to print code with line numbers on Mac
Line numbers in the margin, a light theme on white paper, and long lines wrapped rather than clipped — with every option and its default.
Export code to PDF with syntax highlighting
A source file as a PDF that still reads like code — where the export lives, what lands on the page, and when printing to PDF is the better route.
Export code to HTML with syntax highlighting
A source file as a self-contained HTML page with its colours intact — plus the RTF route for documents and slides, and the two clipboard commands that send coloured code straight into a chat or an issue.
Mac text editor settings
Fourteen panes, one search field, and two settings that keep a place of their own on the toolbar — a map of the Settings window and the fastest route through it.
Accessible text editor for Mac
What VoiceOver, Reduce Motion and Increase Contrast get in Note My, the nineteen toolbar names in bar order, and the gestures and shortcuts that drive them.