Write once, never write again

Nikita
8 min readSep 18, 2017

This is old article, I now use Keyboard Maestro & Karabiner to do these snippets.

I wrote about Typinator briefly before where I talked about how I use it to quickly make expansions for natural text input of Fantastical calendar. However you can take this idea of automating your text input further.

And in process, save a lot of time. This article is about my approach to making Write once, never write again statement come true for me.

More often than not, I say the same things many times. Things like

Thank you.

Is it possible to do?

Looking forward to hearing from you

and more. There is also personal stuff that I very often have to type. My email (or multiple emails in my case), my Twitter/GitHub/Linkedin pages, my phone number, my address. Same keystrokes written to the screen every time again and again. So much lost time.

There is a saying in programming world, Don’t repeat yourself. And that above, sure sounds like a lot of repeating. Fortunately there is a solution to this little problem that you can use.

Typinator is a neat little utility that you can use to solve this. It is a text expansion application that lets you save snippets of text and assign an expansion string to expand that snippet of text. For example, since I write Thank you. so often. I could create a text expansion that would expand Thank you. when I write :ts . Three keystrokes instead of 10. Here is how such a text expansion looks like in Typinator:

So that’s the basic idea behind text expansions. You assign something short, to expand something larger, saving keystrokes as result. Your expanded snippets can also include formatting and you can even move your mouse pointer to start at some place in your snippet in cases where you need that. And your snippets can also include text that is dynamic. For example your clipboard or an output of some script. Here is an example of a more complex text expansion that I use a lot:

If you know Markdown, this will create a Markdown hyperlink where the link that goes between () will be taken from my clipboard. And it will also place my cursor in-between [] so I can give a name to my hyperlink. This expansion alone saved me countless hours already writing GitHub README’s, answering to GitHub issues and many more places where I need to use Markdown.

However having many expansions with many text abbreviations to expand them brings a problem. You will need to remember these abbreviations. And if you don’t, well, these expansions are of no use. Fortunately that problem is solved too for you. You can simply search through your entire library of expansions with quick search. Here is how that looks:

So I can see that typing :a in the quick search menu shows me my markdown link expansion. I can also search for other things:

Yeah. I like thanking people. 🙂

So just like that. I can search for thank you and choose any of the replies there without ever again typing it in full again. I can even make searches like that:

When I know what I want to say. Since Typinator supports fuzzy searching, I can just include parts of words that are included somewhere in my expanded string and that string will surface to the top of my results. Awesome. 🎊

Now that we know all that. Let’s take this a step further.

Expand everything

Here’s a thing. Expanding long phrases is pretty sweet and does save a lot of time. But what about words. Specifically, long words. Like perseverance or memorization. Both of these words are 12 characters each. That is I need 12 keystrokes to type them out every time I use them.

Well one thing I started doing is I started indexing both all the various phrases I type and long words like this. I also always add a space to each expansion since usually a word is followed by a space and then another word.

In Typinator you can create Sets to give a theme to your text expansion. For example the expansions I did for Fantastical app were put in the set Fantastical. And these word expansions, I put in a set I called Words . And here is how that set looks for me:

As you can see, each of these expansions, doesn’t have an abbreviation. And that is because it would be painful to come up with an abbreviation for every single one of these words and then somehow try to keep all of that in my head.

Instead, I only rely on the power of quick search I mentioned earlier. Which as a bonus point, learns from what you choose. So if, when I type spo and I get transportation as first result:

But I actually want corresponding. After selecting corresponding a few times, Typinator learns to show me what I want:

And that is very powerful. Because now I can rely on my text expander to show me the right expansion instead of me always looking at the results and picking what I want.

And similarly I can also search through my Sentences Set which contains phrases that contain more than 2 words in them:

And they can include more complex things like moving the mouse caret to any place I want, include clipboards and more.

To make all this work however, you need two very close by to you hotkeys. One for opening quick search and one for making a text expansion snippet from selected text. You can assign these hotkeys in the settings of this app. For me, I assign them to a hotkey and then call from Karabiner so opening up quick search becomes pressing s + o and making snippets from selected text is f + d for me where f is my Karabiner made modifier key. I will write an article on how you can do that soon.

And just like that, I have changed how I think about writing. Now, when I know that a word I want to type has more than 6 characters, I routinely open quick search and simply enter few characters from that word and press enter. And that will expand that word and add a space in the end so I can go on writing what I want. And if I know that what I want to write is a phrase, I do the same and leverage on the power of fuzzy searching to make my expansion. And in cases where I have searched for a word or a phrase that I have not yet indexed and my search comes up empty. I write what I wanted to write myself. Once.

Index it. And never write it again.

Making expansions even faster

So Typinator is awesome. And these text expansions are pretty neat indeed. But. There are certain things that I type so often that I want an even faster access to them than:

  1. Opening search
  2. Typing few characters
  3. Press enter

You may think, how can something be faster than that. That’s already pretty insane. Well, meet Keyboard Maestro.

More specifically meet one of its features. Palettes.

Expanding text with Keyboard Maestro Palettes

A palette, is a little overlay menu that you can show with a hotkey where you can specify what goes inside of it. In essence Keyboard Maestro is a way to create macros that contain various actions inside and that can be called from some trigger. Usually that trigger is a keyboard hotkey.

For more information on Keyboard Maestro, you can read the app’s manual and of course try out the free trial of it here. It will be worth it. I promise.

Given this super short introduction to a very powerful utility. Here is how we can use it to make our three steps of expanding our text even faster.

I created a palette that expands all the different personal snippets I have. You can see this palette below:

Above you see the definition of this palette in Keyboard Maestro. The palette is called s:personal and it has many actions inside like: twitter (my twitter handle), name (my first and last name), gmail (my gmail email), website (my personal website) and few more.

The website macro is actually selected and it shows a trigger action, in this case this trigger is letter W. And then inside this macro there is one action. The action is to insert text by pasting which simply means paste the text I specify.

I then assign a hotkey to activate this palette:

The horrendous looking hotkey there does not matter because I call this palette from Karabiner.

And then I can open up this palette and use whatever is inside there from wherever I am. I press my hotkey and my palette shows up:

And then any of the letters on the right will activate the macros that will expand the text I specified there. Below is a little video I made where I ‘write’ a GitHub repository for a new workflow I made using all of the tricks I mentioned above.

Video Demonstration 👀

More Palettes

And here are some screenshots of Keyboard Maestro palettes that I used when I wrote the README in the video:

Emojis
Responses
Questions
Markdown code blocks
Unicode symbols

And finally, you can also find the Typinator Sets that I have made here and the KM palettes I made here.

--

--