OSX Keyboard Fluency

Fluency with one’s tools is something that I quietly judge people on, probably unfairly. Sorry. Also, I’m not always quiet. Double-sorry?

It’s also something I never overlook when pairing or co-working with someone. Spend a little time driving a Unix command line with me and you’ll hear something like “Up, Control-A, Option-D, rm, Enter.” I can’t even watch a friend look for a YouTube video without saying, “You can press ‘slash’ to jump to the search bar!”

I love eliminating slow steps with shortcuts. Hopefully this will explain how I learn, relearn, and apply them.

The remainder of this article uses a first person instructor voice.

Memorize Symbols

The first thing you’ll need is the ability to read more than letters and numbers. Here are the important ones for reading shortcuts on OSX.

⌘ is Command

The command key used to be the Apple key, and has an interesting history (⌘-click to open in a new tab for reading later). Apple put it in the most dominant space for a modifier: on both sides of the space key.

⌃ is Control

“Control is a carat.” Say that out loud 10x, maybe while looking at one or next time you open a pull-down menu. Really emphasize the alliterative “k” sound on the two words. I even reduce it in my brain to those starting sounds alone, further and further back in my throat. Then down to a single one, thinking of it as similar to the sound it makes when I hit it, which is with a little extra force because of its position.

You might try muttering it out loud like this:

⌥ is Alt or Option

Doesn’t it seem satisfyingly symetrical that the modifier key with two words (“alt” and “option”) has a glyph with two markings? One is even has more letters and is longer than the other.

⇧ is Shift

The shift key makes things upper case. Up.

Ok, now you have the same mental tools I do for reading the symbols displayed along side menu choices in OSX. You even may have some new ways to recall information with shapes, symmetry, sounds, somatic sensation in your throat, tactile thud…

Now it’s time to put them immediately to action.

Learn a Shortcut

Go look at something you use a lot, and find out if it has a keyboard shortcut. Hover your mouse pointer over the “make it bold” button in your word processor. Does a tool-tip show up with a description of a key like “Ctrl-P”? Or a name? Is there an equivalent to that button in the “Edit” pull down menu? How about looking in the browser “History” menu and noticing the ⌘-[ and ⌘-] next to “Back” and “Forward”. Try them.

Like, right now.

Go to another browser window you already have, click on a link, then try out ⌘-[ to come back from that link. Then ⌘-] goes forward again. See? Now you can do that gesture with left thumb and right pinkie instead of finding your cursor and mouse!

For many shortcuts, I initially pull my left hand down to where it can reach all four modifier keys easily. As I get more used to the combinations or key positions, I start using them more with my thumb and pinkie.

Pinkie? Yes, pinkie. I press my control key with my leftmost finger on my left hand… Because I made my Caps Lock a Control key.

Fix Your Keyboard Layout

Almost all keyboards have a useless vestigial key: Caps Lock. I know some of you just thought, “I use that all the time!”. First: no you don’t. Second, it’s actually way more useful if you reconfigure it as another Control key.

OSX has an easy way to fix this.

Just bring up the Keyboard settings in System Preferences. I like to press ⌘-Space to bring up Spotlight search and type “Keyboard”, it’ll probably be the first result.

Under the “Keyboard” pane, down in the lower right, click the “Modifier Keys…” button. In the resulting window, change the Caps Lock key by changing from “⇪ Caps Lock” to “⌃ Control” in the adjacent pull down.

Re-map Caps Lock

Before you click Ok, make sure your Caps Lock isn’t already on: you’ll end up confused. Yes, I’ve done it twice.

Now you have a Control key by your left pinkie. It’s big, and near, and easy to use!

And if you need to type something in upper case, hold down shift or figure out how to make your editor transform text. My editor, emacs, has the combination M-u (special emacs notation) that turns a whole word to upper-case in one keystroke. Does yours? Can you add a plugin or change a setting to help make that task faster?

How many times would you like to make default_size into DEFAULT_SIZE? Or the other way around? Would it be worth doing it with a single keystroke and zero typos?

Learn To Move Like an Old Guy

OSX has underpinnings in Unix that go back decades. While there are many modern keyboard chords (a key with one or more modifiers), many of the classics still apply.

If you search for old shell and emacs reference sheets, you’ll find that they share a lot of ways of using the Control and Alt keys (sometimes called “Meta”) to operate on text. Some of these are generalized from Unix to Mac default behaviors. Here are some that work at a command line, a Google Document and even a Facebook comment text box.

KeysAction
⌃ FForward one character; like right arrow, but closer to the home row.
⌃ BBackward one character; like left arrow.
⌃ DDelete the character at the cursor.
⌥ FForward one word, like a super right arrow.
⌥ BBackward one word, like a super right arrow.
⌥ DDelete the word at the cursor.
⌥ BackspaceSuper backspace, a word at a time.
⌃ WUltra backspace, from the cursor to he beginning of the line.
⌃ AJump to the beginning of the line (or last time you hit Enter).
⌃ EJump to the end of the line.
⌃ KKill/delete everything from the cursor to the end of the line.

When you read through this table, did you go “kek” in your throat? How did you remember the key for the symbol “⌃”?

In a terminal, there are a few more that fall under the category of interactive command line editing.

KeysAction
⌃ RReverse search history of commands.
⌃ CAbort the command you’re typing.
⌃ _Undo your last edit. Yes, there is undo.
TabAttempt auto-complete.
⌃ LClear and redraw the screen.
⌘ KKill terminal history, then clear and redraw the screen.

Since it has more features, and is configured better out of the box, I use and recommend iTerm rather than Apple’s Terminal.

At this point, you should be able to read my instructions in the first paragraph.

I was at a terminal prompt after an ls command, and wanted to now delete that same file. Rather than type the command in myself, “Up, Control-A, Option-D, rm, Enter”. This translates to: go up to the previous command, jump to the beginning of the line, delete the word at the cursor (the ls) and type in rm in it’s place. Enter completes the command from anywhere on the line.

How many other commands are variations on each other in their arguments or patterns?

Curious and Lazy, Wary of Rodents

That should be enough to get you started. I’ve used these basic tools, memory techniques, and resulting keyboard shortcuts every day. Does every one of them save you time over mouse alternatives or in every single context? Nope. But keeping your hands on the keyboard is often better than moving over to the mouse, especially if it is something you do frequently.

Now hit Command-L to jump to your browser’s location bar, then Command-C to copy the URL, and share this post with a friend. Maybe trade your favorite tip with them, too!

Stay curious, find ways to do less work, and keep away from those pesky mice when you can.

I’ll probably still judge you though. I really am working on it; sorry.