How to auto-close brackets and quotes on Mac
You can do this with Note My. Six pairs close themselves, a selection is wrapped in one keystroke, and a closer you reach is stepped over rather than doubled — with a separate switch for each part.
You type an opening bracket and you want the closing one to appear. Or the opposite: an editor keeps putting characters in your document that you did not type, and you want it to stop. Both are the same feature, and in Note My it is one group of five switches you can set independently. This guide covers which pairs are handled, what happens when you type the closer yourself, how a selection gets wrapped, and how to switch any part of it off.
The six pairs that close themselves
Auto-pairing covers the six pairs you reach for constantly:
| You type | You get | Kind |
|---|---|---|
( | () | Bracket |
[ | [] | Bracket |
{ | {} | Bracket |
" | "" | Quote |
' | '' | Quote |
` | `` | Quote |
In every case the caret is left between the two characters, so you carry on typing where you meant to. The three bracket pairs are also the three you can fold, so a block you open this way can later be collapsed by double-clicking either of its braces.
Pairing never pushes a closer into the middle of a word: put the caret inside word, type (, and you get the one character you typed and nothing more. Nor does it tire in a long document: our large-file engine keeps very long files moving, so pairing stays as immediate in a thousand-line log as in a two-line note. All of it happens on your Mac — no account, nothing uploaded, the same behaviour offline.
Angle brackets get whole tags instead
A less-than sign is left exactly as you typed it, in every language, so a comparison such as a < b stays the three characters you meant. In markup, angle brackets are given something more useful than a pair.
When the document's language is HTML, typing > at the end of an opening tag inserts the matching closing tag — type <section> and </section> appears after the caret, with the insertion point left between the two so you can start writing the contents straight away. Three things are worth knowing about how it behaves:
- It follows the language your document is in. Our advanced language identifier sets HTML for you on a page saved as
.html, so tag closing is ready the moment the file opens. If a document has come up as something else, set it to HTML yourself from the status bar and you have tag closing there too. - A closing tag is written only where one belongs. Finish a closing
</div>, or a self-closing<br />, and your markup is left exactly as you wrote it rather than doubled up behind you. - Void elements are understood —
br,img,input,hr,meta,link,area,base,col,embed,param,source,trackandwbrtake no closing tag, so none is written and you are never deleting a stray</br>back out of a line.
A habit worth picking up for any element that will carry a long list of attributes: write the pair first, <div></div>, then put the caret back inside the opening tag and add the attributes there. The structure is correct before the detail goes in, which is the order that reads best in a diff and the order that leaves you least to check afterwards.
Typing over a closer instead of doubling it
The usual complaint about automatic pairing is the second closer: you type (, get (), type your argument, then type ) out of habit and end up with ()).
That does not happen here. When the character to the right of the caret is a closer Note My inserted for you, typing that same closer moves the caret past it and changes no text at all. Only the insertion point moved.
Type-over moves the insertion point; it does not change your text. It fires exactly where you want it — when the closer Note My inserted is sitting immediately right of the caret — so you can type the closing bracket out of habit and still finish with one. Anywhere else in the line, a closer you type is inserted as usual, and you keep the character you asked for.
Wrapping a selection in brackets or quotes
Select a run of text and type any of the six openers. Instead of replacing your selection, Note My puts the pair around it and re-selects the inner text — so the selection you had is still the selection you have, now wrapped. That makes quoting a bare string, parenthesising a sub-expression or backticking a term in prose a single keystroke. Because the inner text stays selected, you can wrap twice: select the word, type (, then ", and you have ("word") with the word still selected.
Apostrophe protection: why "don't" stays one word
Quote pairing would be intolerable in prose without a rule for apostrophes. The rule is worth knowing exactly: quote pairing is suppressed when the character immediately before the caret is a letter or a digit.
So typing don't gives you don't, and it's gives you it's. The same rule covers a possessive after a number. Start a quote at a space, a bracket, an operator or the beginning of a line and it pairs as normal. Brackets need no such rule and pair wherever you put them, so a letter or a digit before the caret still gives you the closer.
Turning any of it on or off
There are five switches, all on by default and all independent: a master switch for smart editing, plus one each for auto-indent on Return, bracket pairing, quote pairing and HTML tag closing. Turning off brackets keeps quotes. Turning off the master switch stops all four.
-
For everything at once, use the toolbar
The Smart Edit button in the toolbar — the sparkles glyph — is the master switch. Its tooltip reads "Smart Editing: OFF — plain newlines and typing" when it is off. Click it and the button latches into a solid accent disc with a white glyph, so the change you have just made shows on the bar without you hovering over anything.
The same command sits on the Edit menu as Edit ▸ Smart Editing, so you can reach it from the menu bar whether or not the toolbar is showing, and both routes move the one setting.
-
For one assist only, open Settings
Press ⌘, and choose the Editing pane. The individual switches for Return, brackets, quotes and tags live there, under the master. The sidebar search field covers every row in every pane, so typing a word from the setting you want will find it. The dependent rows grey out when the master is off, rather than leaving you a hidden state to remember.
-
Check that it took
Type an opening bracket into a scratch document. If the closer appears, pairing is on. ⌘N gives you an empty tab for the test, and a tab you never save leaves nothing behind in the Finder. Unsaved work is looked after by our auto-recovery safety net, so a throwaway tab costs you nothing. Test quotes in the same tab: type a quote after a space, then type
don't.
Auto-pairing in a plain-text note
Pairing is there for prose as much as for code. In a document set to Plain Text, brackets and quotes still close themselves, the apostrophe rule still applies, and wrapping works exactly as it does in a source file: select a phrase and type " to quote it, ( to parenthesise it, or ` to mark a term you want to set apart. A page of notes and a page of markup put the same six pairs under the same fingers, so nothing has to be relearned when you move between them.
In prose the characters you typed are the characters you keep: no smart-quote substitution, no dash substitution, no auto-correct and no data detection anywhere in the editor, in any mode. Plain Text mode turns on the system's spelling and grammar underlines and nothing else — underlines suggest, they do not edit.
What pairing does to Undo and to macros
Three things matter if you rely on ⌘Z or on recorded macros.
- Type-over is invisible to Undo. Stepping over a closer changes no text, so there is nothing to take back; ⌘Z goes to the last real edit you made.
- Auto-indent on Return is fully undoable. The indentation added when you press Return comes back out with a single ⌘Z, and our macro recorder captures it like any other edit.
- A macro run undoes in one step, shown in the Edit menu as "Undo Macro Playback", so one ⌘Z reverses the entire run rather than unwinding it keystroke by keystroke.
Press Return and our indentation engine gives you the same indentation as the line you were on, one level more after a trailing {, [, ( or :, and — when the matching closer is the very next character — the pair opened onto three lines with the caret on the middle one. That applies to a plain Return, so every new line arrives at the depth you were already working at and you can keep typing without reaching for Tab.
Troubleshooting
Switching pairing back on
If an opening bracket is arriving on its own, without its partner, the master switch is waiting for you. Click Smart Edit in the toolbar, or use Edit ▸ Smart Editing, and all four assists come back in one action. With the master already on, brackets have their own row in Settings ▸ Editing: turn that one on and pairing resumes from the very next character you type, in the document you already have open.
Seeing at a glance which state you are in
Settings ▸ Editing lays the whole picture out as rows you can read at leisure: the master at the top, the switches for Return, brackets, quotes and tags beneath it, and the dependent rows greyed while the master is off. That is the pane to open when you want every assist accounted for in one reading, and the sidebar search field will take you to it from wherever you happen to be. For a change on the spot the toolbar is the shorter route: clicking Smart Edit moves the setting and redraws its glyph in the same action, latching the button into a solid accent disc with a white glyph, so the button in front of you is the switch you have just thrown. All three routes — the Smart Edit button, Edit ▸ Smart Editing and Settings ▸ Editing — drive the one command, so reach for whichever is nearest your hand and open the Editing pane when you want the full picture in front of you.
Getting tag closing working in this document
Tag closing follows the document's language, so point this one at HTML. Click the Identify pill in the status bar to open the Language Inspector, which states "Identified programming language: X" and lets you set the language yourself. Our advanced language identifier gets most pages ready to work the moment they open; when this one has come up as something else, set HTML in the inspector yourself and tag closing works from the next character you type. The choice sticks for that tab, so you set it once and carry on.
Getting one closing bracket where you typed one
Type-over steps in when the auto-inserted closer is the character immediately to the right of the caret, which is where it will be if you have simply typed the contents and stopped. Type the closer there and the caret hops over it. If you have already moved the caret further along the line, the pair behind you is complete as it stands, so you can carry straight on and leave the closer to do its job.
Placing a quote pair next to a word
Quote pairing takes its cue from the character immediately before the caret: begin the quote at a space, a bracket, an operator or the start of a line and you get the pair. That is the same rule that keeps an apostrophe inside a word single, so don't and it's come out as words. When you want a pair hard against a word, type the space first, take the pair, then close the gap up.
Setting the indent width you want
Indent width and tabs-versus-spaces live in the Indentation sheet, opened from the Indent button in the toolbar. The default is four spaces and the sheet takes anything from one to twelve, so you can match whatever the file you have been handed already uses. Nothing in that sheet changes your document until you press Apply, which makes it safe to open and read before you decide. Save first, and if you would rather have the saved version back afterwards, File ▸ Reload from Disk (⌘R) brings it straight in — reloading never changes the file on disk.
Getting the most out of it
- Reach the master switch three ways. The toolbar button, Edit ▸ Smart Editing and Settings ▸ Editing all move the same setting, so whichever is nearest your hand at the time is the right one to use.
- The same six pairs everywhere. Brackets and quotes behave identically in every language, so the habits you build in one file carry straight into the next without you having to remember which rules are in force. Tag closing is the one part that reads the document's language, and that is exactly where you want it to.
- Pairing does three things: it inserts a closer, it wraps a selection, and it steps over a closer it put there. It never reformats or rewrites anything else you have typed.
- Wrap, then wrap again. Because the inner text stays selected after a wrap, layers go on one keystroke at a time —
(, then", then`— which is quicker than typing six characters and repositioning the caret twice, and it never leaves you with a stray closer to hunt down. - Keep a scratch tab open. ⌘N costs nothing, and it is the fastest way to confirm a switch did what you expected before you go back to real work.
Frequently asked questions
Will the editor turn my straight quotes into curly ones?
Your quotes come out as the characters you pressed. No text-mutating assist of that kind is enabled in any mode — no smart quotes, no dash substitution, no auto-correct, no link detection. A quote you type stays the quote you typed.
Can I keep auto-indent but stop brackets closing themselves?
Yes. The four assists — Return, brackets, quotes and tags — are separate switches under a master in Settings ▸ Editing. Turn off the bracket switch and the other three carry on.
Does auto-pairing slow the editor down in a very large file?
Pairing stays immediate however long the file is. Our large-file engine is there to keep long documents responsive, so typing in a very large log feels the same as typing in a short note.
What do I get when I type an angle bracket?
In HTML you get the whole closing tag: type the > that finishes an opening tag and </section>, </article> or whatever you opened is written after the caret. Elsewhere a less-than sign stays the single character you pressed, so prose and comparisons such as a < b come out as you wrote them.
What happens when I type {{ for a smart token?
The braces pair as usual, and our template library tidies up after itself: when you accept the token, the auto-paired closing braces go with it rather than being left stranded on the line.
Does any of this send my code anywhere?
Everything stays where you put it. Note My contains no networking code of its own; the only network activity is performed by Apple’s own system services, to establish purchases and transactions state. There is no telemetry, no account, no sign-in and no update check. Pairing, indenting and tag closing all happen on your Mac, and your files never leave the machine.