Academic Time-Savers: Text Entry on a Mac
/Meghan Duffy tweeted a CHE article by Anne Curzan about using (or overusing) em dashes, which led a few folks on Twitter to point out ways to type a true em dash (— instead of --, for example). On an iOS device, you can simply press and hold the hyphen to get a pop-up list of other dashes. On a Mac, you can hold the shift and option keys (some know option as the alt key) while typing a hyphen. But you have to remember which key combo to press, and if your habit is to type --, it can take a long time to get used to Shift+Option+-.
Making your own shortcuts
If you don’t want to relearn the keys you’re pressing, you don’t have to. You can make your own shortcut so that when you type -- it becomes —. The best part of this trick is that it applies well beyond em dashes. You can use text shortcuts like this one to save yourself time in all kinds of ways.
Here are a few example uses:
- Greek letters: Want to insert α, β, Δ, λ, etc. without having to pull them from a menu each time? Set up a shortcut. I used “aalpha,” “bb,” “dd,” and “ll.” The text doesn’t get replaced mid-word, so “add” and “all” never become “aΔ” and “aλ.”
- Capitalization: In grad school I worked with genes and proteins like TcpP, toxT and mCherry. These spellings and capitalizations make sense to biologists, but not to spelling & grammar checkers. For my toxT knockout cells I could type “ddtoxT” and get “ΔtoxT” every time. Even more helpful was the shortcut for the TcpP-mCherry fusion. Before making a shortcut I frequently mis-capitalized the protein. In this case, my shortcut was simply “tcppmcher.” I didn’t even need the whole word, just enough to be unique and memorable.
- Special characters: As a chemistry professor, I use a lot of reaction arrows in my lecture notes and worksheets. I use the shortcut “xrarr” to give me a right-facing arrow (→).
- File paths: In grad school I needed to enter the paths for a small handful of folders very frequently. Instead of typing them out or copying and pasting every time, I gave them shortcuts that would be replaced by the full file path, correctly spelled, capitalized and spaced, every single time.
- LaTeX: I like working in LaTeX, but there are certain commands that I have trouble remembering. Using custom text shortcuts, I can type something I do remember and have the correct LaTeX appear instead.
- Correcting your own typos: I found myself typing my last name as “HAas" a lot, so I made that into a shortcut that corrects itself to the proper capitalization. Similarly, I can’t count the number of times I’ve typed “teh” instead of “the” or misspelled the name of my university (I am forever typing “Misericorida”). My shortcuts make me look like a much better typist than I am and save me much embarrassment.
How do you pull off these shortcuts? There are a few ways.
Built-in text replacement on the Mac1
Go to System Preferences > Keyboard > Text and click on the + button in the lower left, beneath the “replace with” list. In the left box type the shortcut you will use, and in the right box type (or paste) the text that you want that shortcut to be replaced with. (You can use Tab to switch between boxes.) Press Enter when you’re finished.
For example, to get double hyphens replaced with an em-dash, type “--“ in the left box and Shift+Option+- in the right box. Now whenever you type “--“ on your Mac, an em dash will show up instead.
If, for some reason, you don’t want the shortcut to complete, pause after typing the second dash, and a little window with blue text will appear. You can click the X with your mouse or press Escape to cancel the shortcut and continue typing normally. (You can also undo a text replacement by using the undo command of whatever text editor you are using, usually Command+Z.)
Text replacement software for the Mac
Most of the text shortcuts I use aren’t in my Mac’s system-wide settings. Instead, I use TextExpander 5 ($45), which does everything the built-in system can do and much more. Until recently, I would have recommended TextExpander for anyone who wants to up their typing efficiency. However, the latest version of the app has changed pricing models ($40+/year) and now incorporates a sync service that I have no interest in. Other text replacement apps exist, but I have very little experience with any of them, so I don’t feel comfortable weighing in.
Built-in text replacement on iOS2
Go to Settings > General > Keyboards > Text Replacement and tap the + button in the upper right corner. The first box is the phrase you want to have after the shortcut runs. You can paste text from the clipboard, including special characters that you’ve copied. The second box is the shortcut you’ll type to get the phrase text.
For example, to get “aalpha” to be replaced with “α,” copy the α character from a file or website and paste it into the first box. Then type “aalpha” in the second box and tap “Save” in the upper right corner. Now whenever you type “aalpha” on your iOS device, an α character will show up instead.
If, for some reason, you don’t want the shortcut to complete, pause after typing the second dash, and a little window with blue text will appear. You can tap the X to cancel the shortcut and continue typing, or, if you’re using predictive text, choose the literal text from the list above the keyboard.
There is also a version of TextExpander for iOS ($5), but it’s not system-wide unless you install a clunky virtual keyboard.
What about Windows?
I prefer Macs, but I know a lot of the world uses Windows PCs. My workstation as a grad student ran Windows 7, and I did not want to give up the power of my text shortcuts. Fear not, if you use a Windows computer, you too can benefit from the time savings of text replacement.
The app that I used is called Breevy ($35). If you also have a Mac with TextExpander 5 or earlier (i.e. from before the sync service), you can use Dropbox to sync your shortcuts (which TextExpander calls “snippets”) between TextExpander and Breevy.
The latest version of TextExpander also has a Windows version. I haven’t used it at all, but if you’re interested, it’s there.
Inserting special characters
Let’s say you want to make a the shortcuts for α or →. It’s simple enough to type the text you want to replace, but how can you easily get the characters that should appear when the shortcut runs? On a Mac, you’ll want to take a look at the Character Viewer.
In the Keyboard settings, choose “Show Keyboard, Emoji & Symbol Viewers in menu bar.” A little flag will show up near your system clock, if it wasn’t there already. Click on the flag and choose “Show Emoji & Symbols.” You’ll get a screen of special characters that you can double-click to insert into whatever text box is currently selected. Characters you use frequently can be added to a list of Favorites with the click of a button. The Favorites list is good for symbols that you don't use frequently enough to merit a text replacement shortcut, but often enough that you don't want to hunt for it every time. If there are other characters you want that aren’t listed, select “Customize List…” from the gear drop-down menu to get a list of symbol categories.
Saving Time
Turning your double hyphens into em dashes may not save you much time, but having common typos that correct themselves, typing special characters without having to hunt them down, and using a few characters to type words and phrases you use frequently can all add up.
I hope you find these tricks as helpful as I have over the years. Happy typing.
1: Instructions and screenshots are from Mac OS X El Capitan (v10.11.1)
2: Instructions and screenshots are from iOS 9.3.1