Keyboard shortcuts, it’s a love-hate relationship. On one hand, they unlock hidden cheat code levels of productivity — on the other, they unlock… What was that again? … Oh yeah, you just can’t remember them! What is it about keyboard shortcuts that makes them so hard to remember? Should you even bother? Is there a reliable way to learn them?
Why is it so hard to remember keyboard shortcuts?Simply put, there’s so many shortcuts to remember, and their use taxes a different class of memory.
To use a keyboard shortcut, at least initially, requires exercising your “recall” memory system instead of the easier “recognition” memory system. Which type of test question is easier, multiple choice, or short answer? The multiple choice question is easier because it provides clues to help you “recognize” the answer. Straight recall is much harder because you aren’t given any clues. This is also why the command line is harder to learn than a GUI. The GUI provides contextual clues and prompts; the command line only provides you with the, um… prompt. :$ It’s the same for keyboard shortcuts. You don’t have a graphical menu with icons and text labels to cue you as to their purpose; everything must come straight from your brain.
We all know a few keyboard shortcuts, like Ctrl-C and Ctrl-V, because we use them every day, multiple times a day. If you grew up using Microsoft Windows, you quickly memorized Ctrl-Alt-Delete for the same reason — daily use due to lockups and blue screens of death. More arcane shortcuts might only receive occasional use, so when your brain is cleaning up the clutter and comes across Ctrl-Shift-R-M, but you haven’t used it in two days, what’s it going to do? It’s going to dump that ridiculousness. However, there is a way to bypass this pruning process, as you’ll see in a minute.
Is learning the keyboard shortcuts worth the effort?
Keyboard shortcuts make you really fastI fondly remember using AutoCAD in the 90s when you still launched it from a DOS prompt. We made extremely heavy use of dozens of keyboard shortcuts, most of them one or two letter aliases. The non-dominate hand would prance and pirouette over the mechanical IBM keyboard while the dominate hand managed the mouse. You could whip up drawings incredibly fast. We actually bemoaned the release of the Windows-only “R14” version. For us, the more elegant look and elaborate menu system was like an aristocratic bureaucracy — really pretty, but painfully slow. The first thing we researched was getting our shortcuts back.
If you’ve ever watched someone skillfully use Vim or Emacs (particularly Vim), then you’ve seen the power of keyboard shortcuts in action. Sometimes it’s referred to as editing text “at the speed of thought.” That’s what you’re doing with these editors. Once the shortcuts are a part of you, the chrome of the editor steps aside and lets you become one with the text.
Keyboard shortcuts keep you in the zoneI previously discussed learning our automated refactoring tools. One barrier to fluency with a refactoring tool is the need to learn its keyboard shortcuts. If you don’t learn the shortcuts, you have to break your flow to search for a given refactoring in some distant menu. To use a refactoring tool effectively, I believe learning its shortcuts to be essential.
How to learn the keyboard shortcuts — quickly!Yes, you can learn keyboard shortcuts, even thousands of them, and you can get productive within a few weeks. The key is analysis plus spaced repetition learning with Anki.
Analyze the shortcutsTaking a few minutes to mentally analyze and categorize data to be memorized is a proven technique for increasing retention. Take your favorite text editor, JetBrains IntelliJ for example – It has hundreds of keyboard shortcuts out of the box. At first they might seem like a random jumble of hieroglyphs, but their originators weren’t trying to confuse you — there really is a method to the madness. Taking a little time to analyze the shortcuts will bump your recall significantly.
To start, find a list of all of the keyboard shortcuts for your tool of choice, perhaps a keyboard shortcut cheat sheet, like the cheat sheet snippet shown below from JetBrains RubyMine.
Analyze each shortcut. Try to discover commonalities and relationships between them. Do all of the refactoring shortcuts start with Ctrl-R, for instance? Do the mnemonics make sense to you? Ctrl-R-M, for “extract Method”, or Ctrl-R-I, for “Inline method”, for example. Strive to imbue each shortcut with a personal meaning, even if the connection isn’t obvious at first.
This period of analysis will go a long way toward helping you memorize your keyboard shortcuts. For some people this is all they need. If you’re like me however, you’ll need to proceed to the next step: Anki.
Use Anki to memorize all the keyboard shortcutsAnki is a flashcard program with apps for Windows, Mac, Linux, Android, and IOS. It uses “spaced repetition” to make sure you remember every flashcard until its embedded permanently in your cortex. When a flashcard is new, you’ll see it frequently. Each time you remember it correctly, Anki increases the amount of time you wait until seeing that card again. I have cards I won’t see again for close to 11 years. This spaced repetition is the trick we use to keep that neat freak in our brains from pruning away keyboard shortcuts due to infrequent access.
What are the implications for learning those dreaded keyboard shortcuts? The focused and concise nature of keyboard shortcuts makes for excellent flash cards. From my personal experience, if you remember to review your Anki deck everyday, you’ll have your IDE’s shortcuts flowing effortlessly from your fingertips within a few weeks. It only takes 5-10 minutes a day to review your Anki Deck, so we’re talking about a two-hour total time investment over that two-week period. Since Anki keeps increasing the time between each successful review, the future time commitment is minimal. If you’re learning a new refactoring tool, for instance, two hours is a basement bargain price to pay for safe refactoring at the speed of thought.
Tips for using Anki effectivelyFirst off, even though it’s possible, don’t just download a pre-made flashcard deck with all of your shortcuts. There is a lot of memorization value in creating each flashcard yourself. After you’ve installed Anki and created your deck, make a flashcard for each keyboard shortcut you want to remember. For example, you want to remember that Ctrl-R-M is the shortcut for “Extract Method.” Create a flashcard in Anki like this:
FRONT: R# refactoring shortcut: Extract Method BACK: Ctrl-R-M
Notice that the front card includes the context, R# in this case. It’s super important to always include the context in every card that you create. Otherwise you’ll scrunch your eyebrows in consternation when reviewing that card. Inevitably someone will offer you some prune juice. Don’t forget that context.
As you review the card in Anki, don’t just repeat the answer to yourself; visualize a block of code in front of you — a block of code that you want to extract into its own method, for example. Then feel yourself pressing the key combination. Ctrl, r, m… “See” what happens on the screen as a result. It works.
Anki’s spaced-repetition algorithm will allow you to learn even the most esoteric keyboard shortcuts in no time. In the first few weeks, force yourself to use them, even though it will slow you down at first. If you catch yourself using a menu to do something, undo it and do it over using your new keyboard shortcut.