Syncing macOS text replacements with Raycast

macOS, iOS and iPadOS has this neat feature called Text replacements which allows you to create text shortcuts to insert some other, longer piece of text. For example, I would type xem and it’d expand to [email protected] or xme and it’d expand to Sangeeth Sudheer. I chiefly use this to get beautiful glyphs like ↑ → ↓ ← when I’m texting or writing. If you ever typed omw while texting on an iPhone and was pleasantly surprised to see it replaced with On my way, now you know how.

But, I wish this worked always in macOS. For some reason, it never does replacement in the Chrome address bar, my IDEs or my terminal and the many other places where I totally expected it to work. I’m guessing it has to do with native vs custom editor APIs. Because of this inconsistency, I usually have to break my flow by switching to a different app like TextEdit, type out my shortcut and copy back the replaced text or use the emoji picker for the glyphs. Sigh.

Luckily, there is an escape: Raycast. I got to know recently that Raycast’s Snippets feature is kickass and can do a lot of things beyond simple text replacements. And it tends to work everywhere. So, it seemed obvious the solution for me would be to duplicate my config within Raycast and do my work. But this is a pain when I make modifications as I’d have to manually make changes in both Raycast and System Settings since I use these replacements across all my Apple devices.

Thankfully, there’s a way to avoid the chore. I was watching an interview with Max Stoiber on the Raycast YouTube channel where he discusses his Raycast setup. He mentioned the same problem I was having and that he built an extension to sync the text replacements over to Raycast snippets, which is exactly what I wanted! Even though his extension wasn’t open-source at the time of recording the video, it looks like the extension or a similar one is now present on the Raycast store: https://www.raycast.com/raycast/text-replacements

Once you install it and run the command, you get the following screen:

Press Enter and voila, your text replacements are now synced as Raycast snippets! And now my replacements work everywhere in macOS—more consistently than Apple’s native solution.

If you’re trying to set this up for yourselves, I recommend setting Raycast to supersede Apple’s own text replacements as shown below in Raycast extension settings to get this behavior to work better:

The only place this has given me a bit of trouble is inside Obsidian. It sometimes works fine but other times, when I enter my shortcut, the replacement is inserted twice and some of the following text disappears. Luckily, Raycast gives an option to ignore snippets in certain apps in the same screen above so I used it to disable snippets which means native text replacements work as usual within Obsidian.


P.S. If the Raycast team is reading this, please keep up the awesome content on the channel! :)