Snippets and Text Expansion

Boost your productivity by using snippets to save your frequently used text clips. Expand them automatically using a keyword or browse for the right clip in the Snippets Viewer.

The snippets and text expansion features are part of Alfred's Powerpack.

Snippets Emojis

Do you frequently have to type your address, a block of text or website address? Typing them manually takes time, requires looking the same information up every time and leaves you with the possibility of making a typo error.

Saving your text clip as an Alfred snippet ensures that the next time you need it, it'll save you time and be as perfect as the first time you typed it.

Learn how to use snippets:


Creating your own Snippets

There are two ways you can create your own snippets; In your Clipboard History Viewer or in Alfred's Snippets preferences.

In the Clipboard History Viewer

If you're already using Alfred's Clipboard History and you've just copied something to your clipboard which you'd like to save for use later, pop up your Clipboard History Viewer and use the Cmd + S hotkey to save the selected entry to your snippets.

Alfred's preferences will launch so that you can set a name, a keyword and tweak the text for your new snippet. You'll also be able to decide whether the snippet should auto-expand, and assign it a collection.

In Alfred's Snippets Preferences

In Alfred's Features > Snippets preferences, you can create snippets, as well as collections to group your snippets into.

Add new collections by clicking the + at the bottom of the Collection column, or a new snippet with the + at the bottom of the Snippets column.

Including Dynamic and Cursor Placeholders

You can add your own dynamic placeholders for {date}, {time} and {clipboard} content; Use the default formats or any Unicode LDML formats for dates to be more specific with your date formatting.

Dynamic Placeholder Examples

  • ISO 8601 date format: {date:yyyy-MM-dd'T'HH:mm:ssZZZZZ}
  • Day/Month/Year: {date:dd/MM/yy}
  • 12-hr clock with time zone: {date:K:mm a, z}

You can also tell Alfred where you'd like the cursor to move to by adding {cursor} to your snippet text.


Using Snippet Auto-Expansion

Snippet auto-expansion is disabled by default. To activate it, launch Alfred's preferences to Features > Snippets and check the box for "Automatically expand snippets by keyword".

With auto-expansion, you can expand your snippets automatically in any app by typing the snippet's keyword, without popping up Alfred's Snippets window!

1. Activating expansion

Under Features > Snippets, check the box to activate the automatic expansion of keywords. The first time you do this, you'll be prompted to launch OS X's Accessibility preferences and grant the Alfred Text Service access to control your computer using accessibility features.

Welcome to Alfred Expansion

Click "Open System Preferences" to pop up your Mac's Security & Privacy preferences.

Alfred Text Service pop-up

You'll need to click the lock in the bottom left to make changes. Once you've typed your password, you'll be able to check the box next to Alfred Text Service.

Alfred Text Service preferences

Close your System Preferences and return to Alfred's own Preferences.

Now, you'll be able to check the box to "Automatically expand snippets by keyword" and get started with text expansion.

2. Create a snippet with a keyword

Next, create a new snippet or pick a snippet with a suitable keyword. Take a look at the tips for picking great keywords below.

Creating a new snippet

Make sure the checkbox for the snippet you want to auto-expand has been ticked.

3. Type your keyword in a window to expand your snippet in place

To use the snippet, simply type the keyword you set into the app or text field you want. As if by magic, your keyword will be replaced will the full text snippet!

Snippet in action

For your security, Alfred doesn't listen for characters typed when you are in a secure text field, such as a password field, so he won't expand a text snippet in a secure field.

Tips For Better Snippet Expansion

To get the most out of the expansion feature, your keywords need to be memorable but shouldn't be triggered by mistake. Here are some ideas to help you set useful snippet keywords.

  • Use non-word keywords to avoid unexpected expansion; Don't use the keyword date to paste the date, otherwise every time you try to type it's a date!, you'll find yourself saying it's a 01/06/16! as your snippet auto-expands.
  • Start all your snippets with the same non-alphanumeric character, such as an exclamation mark, colon or semi-colon. (e.g. !office)
  • Use unusual capitalisation (Alfred will respect the capitalisation you set, e.g. officE)
  • Use double characters (e.g. ttime)

Advanced Snippet Expansion Preferences

Once you're up and running with snippet expansion, you can make a few additional changes if necessary, by clicking on the cog next to the "Automatically expand snippets by keyword" text in the top right.

Snippet Expansion Prefs

If you use certain apps where you'd prefer for Alfred not to expand, drop them in. By default, Alfred 3 and Alfred Preferences are listed here.

If you want Alfred to expand snippets regardless of where they are within a string of text, you can do so. You can also turn off the "purr" sound you near when expanding a snippet.


Browsing Snippets in the Viewer

If you can't remember your keyword, or you prefer to view a list of your keywords, you can do so by popping up Alfred's Snippets Viewer.

To pop up the Snippets Viewer, you can either set a hotkey for it in the Snippets preferences window, or you can pop up your Clipboard History Viewer with its hotkey and choose "All Snippets" at the top. You'll then be shown all your collections and individual snippets, which you can filter by typing part of the title or keyword for the snippet.

Snippets Viewer

Using the "snip" Keyword

If you know the name or keyword for your snippet, you can get to it quickly by typing "snip" into Alfred followed by either the name or keyword.

Using the

Sharing Your Snippets

If you need to share snippets between your own Macs, you can use Alfred's preferences syncing feature.

To share a Snippets collection, right-click the collection name in the left column and choose "Export". You'll then be able to share this file with friends and colleagues who are also using Alfred 3.

Latest Blog Post:

It's Alfred's 7th Birthday!

CacheFly Campaign Monitor

"Alfred" is a registered trademark of Running with Crayons Ltd. ©2017 Running with Crayons Ltd. All rights reserved.

Terms & Conditions, Privacy Policy, Cookies.