Using Gmail like vi — keep your hands on the keyboard

In my last blog post, “How I tamed Gmail at work”, I explained how I use stars, filters, labels, multiple inboxes, and keyboard shortcuts to manage my work email. Recently I’ve been experimenting with using keyboard shortcuts more frequently to avoid having to remove my hands from the keyboard to reach for the mouse or trackpad. It took some practice, but now it comes naturally and I love the resulting efficiency.

I tend to like keyboard shortcuts because I’ve spent decades using the vi text editor to write code. Vi was originally created in the mid-1970s for the Unix operating system before anyone used a mouse or trackpad, so all of the functionality was implemented as keyboard shortcuts. Because your hands never leave the keyboard, programmers using vi tend to be very fast, especially if they master all of the features. Because of this, it’s still a very popular editor with programmers.

Turning on Gmail keyboard shortcuts

The first thing you need to do is make sure you have keyboard shortcuts turned on. Go to settings (general tab) and turn on keyboard shortcuts.

Gmail keyboard shortcuts

Shortcuts to use when viewing your inbox

  • You’ve probably never noticed it before, but there is a thin blue bar on the left of the first email in your inbox.
  • Press the j and k keys a few times to make the blue bar go up and down the list.
  • To open the email, press o or enter.
  • To select the currently highlighted email, press the x key. You’ll see the checkbox beside the email become selected. Once you select one of more emails, you can take action on it to archive, forward, reply, etc. using the shortcuts below.
  • To search your emails, hit the forward slash /

Shortcuts to use when viewing an individual email conversation

If your current workflow is to open an email, take an action, then go back to the inbox to open the next email, using the following shortcuts will save you a lot of time! While looking at an individual email, you can press:

  • j and k to go to the older/newer email conversation.
  • { and } is similar to j and k but the current email conversation will be archived before moving to the older/newer one.

I tend to use { and } more frequently because I try to handle each email as I get to it rather than postponing action.

Taking action on the currently opened email

  • r to start a reply or a to start a reply-all and put your cursor in the body so you can immediately start typing.
  • f to forward the email.
  • s to star the email. If you have multiple stars set up (see my previous post) — press s multiple times to toggle between different stars.
  • ; will expand all emails in the current conversation. When viewing an email conversation with multiple emails, Gmail collapses the emails that you have seen before, which is mostly awesome, but somtimes I want to re-read the entire conversation from the top. This shortcut eliminates the need to expand each email in the conversation one by one.
  • ! to mark as spam
  • # to delete
  • u will go back to the inbox
  • m will mute the current conversation — When you mute a conversation, new messages added to the conversation bypass your inbox so that the conversation stays archived. Muted conversations will only pop back into your inbox ready for your attention if a new message in the conversation is addressed to you and no one else, or if you’re added to the “To” or “Cc” line in a new message.
  • And don’t forget z to undo the last action!

A real-world scenario

It’s Tuesday and I’m late to work due to my dog’s vet appointment. When I finally arrive and open up Gmail, I have 53 unread emails. Here’s how I attack it:

I first look at my “Unread from the bosses” inbox (one of several inboxes I have set up as explained in my previous Medium post) and handle anything urgent.

I then scan the inbox for various labels that I’m currently tracking to find other time-sensitive emails.

Once I’ve put out the fires, I open the first email in my main inbox and then start using keyboard shortcuts to work the list. My keystrokes look something like this:

{{{ss{{s{{a(send reply){{a(send reply){;{f(forward email){{{sss{;m{{{r(send reply)s{s{{s{{f(forward email){{{{a(send reply){u

Yes, it looks cryptic, but once you get used to these shortcuts, you’ll be amazed at how fast you can work an inbox.

Here’s a breakdown of the first few keystrokes:

  • { archive the email and move to the next one in my inbox
  • { archive the email and move to the next one in my inbox
  • { archive the email and move to the next one in my inbox
  • ss toggle the star to my second one (orange). I have red/orange/blue stars (see previous post)
  • { archive the email and move to the next one in my inbox
  • { archive the email and move to the next one in my inbox
  • s toggled stars to my first one (red)
  • { archive the email and move to the next one in my inbox
  • { archive the email and move to the next one in my inbox
  • a reply-all to the current email
  • { archive the email and move to the next one in my inbox
  • { archive the email and move to the next one in my inbox
  • a reply-all to the current email
  • { archive the email and move to the next one in my inbox
  • ; expand all emails in the current conversation
  • { archive the email and moved to the next one in my inbox
  • f forward the email
  • …and so on

In this example, I started with the newest email and worked my way back in time (newest to oldest). There are different opinions on this, but for me, this works the best because I see the most recent developments, so when I see a separate but related email further back in time about the same topic, I’m already current.

There are many other shortcuts that I’m not covering in this post, but you can see the full list by pressing “?” in Gmail. The Gmail help also has additional details.