How to Quickly Type Symbols (with AHK Hotstrings)

NOTE: This solution will only work in Windows.

If you find yourself needing to type the occasional symbol, you are probably no stranger to how weirdly difficult this task can sometimes be. Even the typically-recommended solutions have some serious pitfalls for quick use:

  • Sure, you can type the ALT Code of the symbol you want by pressing ALT and then typing the 1- to 4- digit code on your numpad. However, typing ALT + 2 4 8 to insert the degree (°) symbol is not my idea of an eloquent solution. To make matters worse, if you are typing on your laptop keyboard, typing ALT Codes gets even more complicated since you now have to deal with likely having no numpad at all and somehow activating one.
  • If you’re on Windows 10, you can press WIN + ;, which will open up the Emoji Panel. You’ll then need to navigate to the symbols section, scroll until you find the desired symbol, and finally exit out of the panel. The Windows 10 Emoji Panel still feels a tad clunky as a solution to typing symbols, especially ones you find yourself using most often.
  • Other typical solutions seem to only go downhill from here in terms of speed and ease of use.

An ideal solution, for me, is to be able to type something closely related to the symbol using only the keyboard without having to memorize a cryptic numeric hotkey code. With AutoHotkey, you can use hotstrings to type strings of characters that can then be replaced with the desired symbol.

AutoHotkey is a free, open-source scripting language that is very simple and quick to get setup and working with immediately. Visit Running Your First AutoHotkey Script for how to install AHK and run a script.

AutoHotkey – Using Hotstrings

Hotstrings in AutoHotkey (AHK) let you define a string of characters that can be replaced by other text. Hotstrings are often used as text-expansions for abbreviations. For example, you could have “btw” be automatically replaced with the text “by the way” whenever you type it.

Hotstrings are incredibly simple to setup, and I highly encourage you to make use of them whenever you can. Once you start using them, you will find ways everywhere to incorporate them into your daily flows.

To define a hotstring, here is the general format:

::btw::by the way
  1. The abbreviation you want to type goes between the pair of colons ::btw::
  2. Enter the text you want auto-replaced to the right of the second pair of colons by the way

By default, the hotstring abbreviation must have an end character (Space, enter, ., etc.) typed before it will trigger the auto-replace text. AHK lets you define options for the hotstrings, including not requiring an end character to be typed.

Hotstring options are changed by adding the option(s) characters between the first pair of colons. An * asterisk is used to allow the hotstring to trigger without an end character:

:*:btw::by the way

This will let you type “btw” and the auto-replace hotstring will trigger immediately upon typing the “w”, instead of triggering only when you type and end character.

One thing to realize is that you’ll want to be mindful about how you assign your abbreviations. Don’t make it something you are going to be typing that you wouldn’t want to trigger the hotstring with. That is, “the” would be a pretty bad hotstring abbreviation definition for “three happy elves” unless you want to have “the” replaced with “three happy elves” every time you type it.

Create Hotstring to Insert Symbol

To start, let’s define a hotstring for inserting the degree (°) symbol:

  1. We’ll set the trigger abbreviation to “]deg”. It should be a very unlikely string to type inadvertently, and still very descriptive and easy to remember.
  2. Hotstring OPTIONS:
    1. I want the degree symbol (°) to replace the text without requiring an end character after we type “]deg”. So, we will use the * asterisk option.
    2. I would like to be able to type the abbreviation immediately after other text (no space in between). For example, I want to type “32]degF” and it should come out as “32°F”. The ? Question Mark allows the hotstring to trigger when typed immediately after text (no spaces between the previous typed word).

Here is our AutoHotkey script to replace “]deg” with the degree symbol (°) when typed.

:?*:]deg::° 

! NOTE ! : Because we are working with symbols (many of which are likely to be non-ASCII characters), when you are saving your script, make sure to change the Encoding to UTF-8 with BOM or the symbols will likely come out wrong.

Just this single line, and that it is! Once you run the script, anytime you type “]deg”, it will be replaced with the degree symbol (°).

Adding More Hotstrings for Symbols

Now you can make as many hotstrings as you want for your most-used symbols! Just put each hotstring on a new line. I also made some for mu (μ), pi (π), and plus/minus (±).

:*?:]deg::°
:*?:]mu::μ
:*?:]pi::π
:*?:]+/-::±

Okay, admittedly, the irony in all this is that in order to setup your hotstrings in the AHK script for the first time, you still need to insert that symbol in by one of the slower methods! But once you’ve done it one time, you are set.

Other Options for Inserting Lots of Symbols

I recommend using these hotstrings only if you are inserting the occasional symbol into your email, notes, documents, etc. However, if you are dealing with symbols more frequently, there are better tools built for this:

  • If you are dealing with occasional equations or a few math symbols, I would recommend using the Equation Editor in Word.
  • If you are typing a lot of equations/symbols, then I would recommend you use LaTeX, a professional typesetting system that is used for document preparation of technical and scientific documents.