Write faster by using snippets to store and insert frequently used text. Expand them automatically with a keyword.
Use the Create Snippet command to store a new snippet. If you specify a keyword, you can simply type it in any application to have it auto-expand in-place. Snippets are handy for frequently used text such as canned email responses, code or emojis.
Search and manage all of your Snippets in one place using the Search Snippets command. Edit existing Snippets, pin your most frequently used ones, and copy them directly to your clipboard
Shared Snippets
If Raycast for Teams is enabled you can create shared Snippets for all members of your team.
Placeholders
You can make your snippets dynamic with placeholders. The supported placeholders are:
Name | Placeholder | Description |
Cursor Position | {cursor} | Moves cursor to the position when pasted directly into an app or injected. Please note that a snippet can contain only one placeholder of this type. |
Clipboard Text | {clipboard} | Inserts your last copied text. The placeholder will be removed from the snippet when you use it if you have not copied any text recently. |
Date | {date} | Inserts only the current date like 1 Jun 2022. |
Time | {time} | Inserts only the current time like 3:05 pm. |
Date & Time | {datetime} | Inserts both date and time like 1 Jun 2022 at 6:45 pm. |
Weekday | {day} | Inserts the day of the week like Monday. |
The format of the date/time placeholders depends on your system preference. You can see samples of the format on the right side of each placeholder when inserting.
Date & Time offset
By default, if you use a date/time placeholder, its value will be set to the current date/time when you insert the snippet. To display a different date/time, you can do offsets using modifiers like +2d
, -3M
etc. This will change the value from the current date/time to the defined offset.
A modifier is made up of 3 components,
- it begins with a “plus” or “minus” symbol, to denote the direction of the offset from the current date/time
- the symbol is followed by a number
- at the end we have a single letter representing the unit of the offset. You can use “m” for minutes, “h” for hours, “d” for days, “M” for months and “y” for years.
You should use spaces inside the braces to separate the modifier from the keyword. Also, you can add multiple modifiers in a single placeholder each separated by a single space.
For example, you can write placeholders like the following
{date +2y +5M}
{time +3h +30m}
{day -3d}
{datetime +1h}
As you can see in the below image, whenever you enter a proper placeholder, the curly braces will turn blue to indicate it. If your keyword or modifier is different from what is described above, you will see the braces remain in the same text color.
Custom Date Formats
Apart from the four system defined date placeholders, you can create date placeholders in your preferred format by creating a placeholder like {date "yyyy-MM-dd"}
. ie. The custom format must be within double quotes preceded by the word date
and a space, should be within the curly braces similar to other placeholders.
Here are some more examples of date placeholders with custom formats and their expected output.
Placeholder | Output |
{date "EEEE, MMM d, yyyy"} | Wednesday, Jun 15, 2022 |
{date "MM/dd/yyyy"} | 06/15/2022 |
{date "MM-dd-yyyy HH:mm"} | 06-15-2022 13:44 |
{date "MMM d, h:mm a"} | Jun 15, 1:44 PM |
{date "MMMM yyyy"} | June 2022 |
{date "MMM d, yyyy"} | Jun 15, 2022 |
{date "E, d MMM yyyy HH:mm:ss Z"} | Wed, 15 Jun 2022 13:44:39 +0000 |
{date "yyyy-MM-dd'T'HH:mm:ssZ"} | 2022-06-15T13:44:39+0000 |
{date "dd.MM.yy"} | 15.06.22 |
{date "HH:mm:ss.SSS"} | 13:44:39.945 |
Points to Note:
- You can mix date modifiers with custom date formats. Just add a space to the end of the format and add your modifiers like
{date "yyyy-MM-dd" +3M -5d}
- All characters inside the double quotes which you use to represent the custom format are case sensitive
- You can add text which is not part of the date format using single quote. For example, you can write
{date "h:mm 'on the eve of' MMMM d"}
which refers to 8:30 on the eve of June 5.