Type your email, address or code snippet with one key press
Your Mac can already type your email address for you. In System Settings > Keyboard, click Text Replacements, add a short code such as “eml” with your address after it, and whenever you type that code followed by a space, macOS swaps in the full text. If you would rather press a key than remember a code, a layer in Typebar can hold your snippets: hold a key you choose, the on-screen keyboard shows what each key types, and one press of E puts your email into the app in front.
Both are worth knowing. Text Replacements are free and already on your Mac. A layer is easier to learn because you can see it. Below: how to set up each, where each falls short, and which snippets are worth making.
Text Replacements: the built-in way
Text Replacements have been part of macOS for years, and they are the first thing to try.
- Open System Settings and choose Keyboard in the sidebar.
- Under Text Input, click Text Replacements.
- Click the + button below the list.
- In the Replace column, type the short code. In the With column, type or paste the full text.
- Click Done.
Now type the code in Mail, Notes or Pages and follow it with a space or a punctuation mark. macOS replaces the code with the full text, and you carry on typing.
A few rules keep codes from misfiring:
- Pick codes that are never real words. “adr” is safe for an address. “home” is not, because one day you will type “home” in a sentence and get your street address.
- Use a pattern you can remember. Words with the vowels taken out work well: “eml” for email, “adr” for address, “phn” for a phone number, “sgn” for a sign-off.
- Keep the list short. Five codes you use every day beat thirty you forget.
If you use iCloud, your text replacements also reach your other Apple devices signed in to the same account, so a code you set up on the Mac works on your iPhone too.
Where Text Replacements fall short
They are at their best with words and short phrases you type mid-sentence. The limits show up in some apps and with longer text.
- Not every app uses them. Apps built on the Mac’s own text system, such as Mail, Notes and Pages, honor them. Some apps, often cross-platform ones, ignore them. Try your codes in the apps you use most before you rely on them.
- They can be switched off in an app. In apps with an Edit > Substitutions menu, such as TextEdit, Text Replacement is an item there. If a code does nothing, check that it is ticked.
- They suit one line of text. A postal address over several lines, or a block of code with indentation, is awkward to enter in the With field.
- You have to remember the code. Nothing on screen reminds you of the list while you type, so codes you rarely use get forgotten, and then you type the address by hand again.
For code, your editor’s own snippets are often the better tool. VS Code, Xcode and JetBrains IDEs each have a snippet feature with placeholders you fill in as you go, and they understand the language you are writing.
A held key that types the snippet
The other approach turns snippets into keys you can see. In Typebar, a layer is a set of jobs that sits on a key you hold. Hold the key you picked, such as right Command or a Hyper key, and the on-screen keyboard changes to show what each key on that layer does. A key on a layer can open an app, type a snippet, send a shortcut, or show a symbol with a caption.
For snippets, that might look like this:
- Hold the layer key and press E: when you let go, your email address is typed into the app in front.
- A for your postal address, P for your phone number, S for your sign-off.
- In your code editor only, a few keys for the lines you type every day.
The board is the reason this sticks. With Text Replacements you have to recall that the code was “adr” and not “addr”. With a layer, you hold the key and read the board. After a week or two your fingers know the letters and you stop looking.
A few details make layers fit snippets well:
- Each layer has its own hold time, so you decide how long a hold it takes to bring that layer up.
- A snippet can run over several lines, so a postal address keeps its line breaks.
- A layer works in every app, or just one. Make one layer for every app with your email, address and phone, and a second that only works in your editor, with code.
- A layer is saved to a file you can share. Copy it to another Mac, or hand a team the same set of standard replies. Your snippets travel with the file, so check what is on it before you send it to anyone.
You make layers in Typebar’s Settings, in the Layers pane. Keyboard layers on a Mac covers them in full, and Right Command and right Option helps you pick a key to hold that you will not miss.
Which to use, and when
The two work differently, and you may well want both.
| Text Replacements | A layer key | |
|---|---|---|
| How you trigger it | Type a code, then a space | Hold the layer key, press one key |
| Seeing what you set up | System Settings > Keyboard | On the board while you hold the key |
| Where it works | Apps that support it | Every app, or one app you choose |
| Best for | Phrases that come up mid-sentence | Text you insert on purpose: email, address, a code line |
| Cost | Free, built in | Part of Typebar |
| Moving to another Mac | Through iCloud | Copy the layer file |
A good split: Text Replacements for the phrases that come up as you write, and a layer for the handful of things you insert many times a day and never want to mistype.
Snippets worth making
If you are not sure where to start, these earn their place quickly:
- Email addresses, personal and work, on two different keys.
- Your postal address, the one you type into every checkout form.
- A phone number, with the country code if you deal with people abroad.
- Your meeting link, for the calls you set up again and again.
- A sign-off you use in support replies or client email.
- Code you type daily: a debug print line, a license header, a command you run in Terminal.
- Names you mistype: a long product name, or a client’s name with accents.
Leave passwords, card numbers and recovery codes out of both. Snippets are for things you are happy to keep in your settings. Secrets belong in a password manager.
Snippets in a recording
If you record tutorials, think about which snippets end up on camera. Whatever types your address, the text lands in the document on screen and stays in the video.
For recordings, keep a second set with a demo email address and a made-up street address, or a layer that works only in the app you demo. Typebar’s Privacy pane also has “Hide letters” for live demos: shortcuts and special keys still show in the overlay, and letters show as dots. That hides what the overlay shows, not what your app shows, so the demo address is still the safer habit. Show keys in a recording without leaking a password covers the rest of that setup.
Typebar is $9 once for up to 5 Macs, and free for 24 hours with everything on.
Questions
Do Text Replacements work in every app?
No. Apps that use the Mac’s standard text fields, such as Mail, Notes and Pages, honor them, and some others do not. Test a code in the app before you rely on it.
Can the layer key be a Hyper key?
Yes. A layer goes on a key you choose to hold, such as right Command or a Hyper key. Hyper key shortcuts has ideas for what else to put on one.
Can I keep code snippets to my editor only?
Yes. Each layer works in every app or in just one, so a code layer can live in your editor while your email layer works everywhere.