Setting Up Text Auto-Expansion for Snippets
With Alfred's Snippet auto-expansion, you can expand your snippets automatically in any app by typing the snippet's keyword, without popping up Alfred's Snippets window!
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".
Want to learn more about Snippets generally? Pop by the Snippets Feature page first.
1. Activate Text Expansion
Under Features > Snippets, check the box next to "Automatically expand snippets by keyword".
Provided you've already granted Alfred Accessibility permissions, you can get started with creating snippets.
If you denied Alfred permissions earlier on, take a look at the macOS integration page to find out how to grant Accessibility permissions.
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.
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!
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 collection-wide prefixes and suffixes to do this.- Use unusual capitalisation (Alfred will respect the capitalisation you set, e.g.
officE
)- Use double characters (e.g.
ttime
)
For more advanced Snippet Text Expansion setup, take a look at the options by clicking the cog in the top right of the Snippets preferences.
These options include; Apps in which snippets should not expand, the ability to turn off the sound when expanding snippets, tweaking options to slow down key events (for slower Macs, or when using non-standard software) and more.