blog

Gmail's shortcuts come from a 1976 keyboard layout

Keyboard-only email is just as relevant as it was when computers didn't even have mice.

Gmail's shortcuts come from a 1976 keyboard layout

Keyboard shortcuts are minutiae that move mountains. Not because they make one hour of work 0.1% more effective, compounding over 40 hours per week, four weeks per month, and so on. No, being able to work without your fingers leaving the home row is simply a way to work in front of a computer that feels a little less like you’re working in front of a computer.

Moving from keyboard to mouse and back is an interruption. It’s a code-switch. “The verb/noun nature of vim makes it so easy to enter a flow state,” is how one Hacker News user described a tool for navigating and editing code with nothing but a keyboard. “The text editor fades into muscle memory, and you can surf waves of code with no bottleneck between mind and machine.” 

Writing emails, like writing code, is more fun when it's fluid, like driving a manual transmission on the open road. And the developers who worked on early versions of Gmail seemed to agree, creating a robust set of keyboard shortcuts that borrowed heavily from the text editors of the 80s and command-line email clients from the 90s.

Type-to-move page navigation

Two Gmail shortcuts stand out as either very strange or very familiar, depending on your background. To someone who has never used a developer-focused text editor, j and k seem like strange choices for moving down and up an inbox or contacts list. Why not use the arrow keys? Or the w and s layout from video games? Why is the down (j) key to the left of the up (k) key?!

It’s a safe bet that these designations were either conscious nods to vi (or its successor, vim) or unconscious ports from developers who used shortcut-driven editors to hop around codebases and terminal screens without touching a mouse. Why those text editors used those letters is partly due to speed and partly because few computers had mice when vi was first launched.

An ADM-3A terminal sitting on a desk. The keyboard and computer are a single piece of unibody hardware

Image from Wikimedia via user Wdwd

Bill Joy programmed vi in 1976 on an ADM-3A “dumb terminal,” which did not have dedicated arrow keys on its attached keyboard. Instead, they were printed on the H (left arrow), J (down arrow), K (up arrow), and L (right arrow) keys, usually invoked by pressing and holding the Ctrl key followed by the direction you wanted. 

Joy’s idea was that you could eliminate the Ctrl key requirement by creating different modes: Command and Input. The latter was for normal text entry; pressing the j placed the letter wherever the cursor was. Hit escape to enter Command mode, though, and j would move the cursor down and k would move it up, no Ctrl key necessary. Fifty years later and those same keys map to the same movements in your Gmail inbox.

But vi was capable of so much more than page navigation. 

A different kind of grammar

In Command mode, you were typically creating strings composed of actions (verbs) pointed at locations (nouns). With this composable approach, you could do things like copy a word, a line, or a paragraph, with just two letters. 

For example, as long as you remembered that the y key stood for yank (copy) and w represented word, you could hammer out yw to yank the currently highlighted word. y$ would yank everything up to the end of the line and y} to the end of the paragraph. 

Today, in Gmail, hitting g followed by i will go to your inbox and gd will go to your drafts. Then, the asterisk key acts as a stand-in for select, allowing you to enter *a to select everything in your inbox or *u for all unread emails.

It takes a bit to learn, but once you remember the shortcut vocabulary, it’ll stick with you for life. And, based on an interview with Joy in 1984, you almost get the impression that he wouldn’t be surprised that his shortcuts became so ingrained in people’s minds and survived this long. “You start out with a clean concept and then sort of accrete guano. It lands on you and sticks and you can't do anything about it really.” You build on what came before.

A list of Gmail's keyboard shortcuts and what actions they're tied to.

Image from...my Gmail inbox via...me

Pressing the / key in Gmail puts the focus on the search bar, similar to Vi’s /[string] command to search for [string] in a document. Add the shift key into the mix, however, and you’ve got a question mark, a character that invokes entirely different commands in both apps. In vi, it was for searching backward from the cursor. In Gmail, a question mark brings up the shortcuts cheat sheet, complete with all of the email-specific hotkeys that Google developers likely assimilated from email-specific tools of the 90s.

Words once chosen

Hitting c to compose a new message or r to reply to an email seems pretty self-explanatory.  And, sure, maybe assigning f to forward is an abbreviation that doesn’t require historical context or influence. But why not d for drafting emails, a for answering them, or r for resending them? Someone made these decisions long before Gmail.

Email’s core language cues seem to originate with the Air Force’s MH Message Handling System, the first email client I could find that used compose, reply, and forward in its 1979 user manual. Only, its syntax didn’t use single-letter commands. MH used command-line operations like comp, repl, and forw and, in the process, laid the linguistic foundations that later software would run with.

The Pine email client interface, running in a command-line interface.

Image from Slackbook.org's Slackware Linux Essentials

The Elm email client launched a few years after MH, with r for reply and f for forward (as well as j and k for down and up, and ? for help). It wasn’t until Pine released in 1992, a spiritual successor to Elm, that the c shortcut was assigned to compose. It also introduced n and p to go to the next or previous message when viewing another email, just like Gmail does today (although those last two may harken back even further to EMACS). 

“I used pine religiously until Gmail had keyboard shortcuts,” user @igetspam commented in a thread about text-based email clients. “Keyboard commands like those in Pine/Alpine allow one to blaze through messages virtually at the speed of thought.” The mappings worked so well because they were mnemonic and carried over from other popular software. Without those associations, the only other way for users to remember shortcuts is for those users to create their own hotkeys.

Programmable and personal minutiae

Gmail developers seem to have first introduced the ability to change keyboard shortcuts as a Labs feature in 2017. Tying that update to the email client arguably most famous for custom shortcuts is more of a stretch than the connections between Gmail and Pine, but it’s a fun callback nonetheless!

The Mutt email client running in a command-line interface.

Image from Wikimedia

"All mail clients suck. This one just sucks less." was the slogan of Michael Elkins’s text-based email client, Mutt, in 1995. It was, as far as I can tell, the first standalone email client that let users remap any default shortcut. All you had to do was edit the .muttrc file from the command line, with changes like bind index j next-entry to reassign j as a down key in the inbox view. Or bind index d noop to stop a d keypress from deleting messages within the inbox view. 

Gmail's customizable keyboard shortcuts screen.

Image from Gmail's Keyboard Shortcuts menu

Whether it’s a direct descendant or not, Gmail offers the same thing after enabling Custom keyboard shortcuts from the Advanced settings window. With that setting turned on, you get access to the Keyboard Shortcuts tab and the ability to remap which keys trigger which actions. 

Gmail is still not anywhere near as keyboard-friendly as Vi, Pine, or Mutt. But, for a time, it was better than most browser-based apps. And even though it leaves a lot to be desired today, Gmail paved the way for shortcut-heavy tools like Superhuman and Hey. 

“I think editors have to come out of a certain kind of community. You need a cultural context.” Bill Joy said back in 1984. Shortcuts are similar. They start small, carving pathways into our collective consciousness, connecting common concepts and actions across apps. Until, eventually, a few abbreviated letters make sitting in front of a computer feel a lot less like sitting in front of a computer.

Published on

June 26, 2025

Filed under

Written by

Ryan Farley

Ryan Farley is a tech writer, craft beer snob, and American expat living in Thailand.