cosine.blue

Blog by Gregory Chamberlain.

Vanilla Firefox Keyboard Mastery

No mouse. No add-on. No problem.

History

Cover image: Photo of fox walking on a road
Cover image credit: Erik Mclean via Unsplash
All software packages mentioned in this article are free as in freedom. There is no need to be using proprietary browsers these days.

Is it worth the time?

Last weekend I carved out half an hour to read Mozilla’s support page titled Keyboard shortcuts - Perform common Firefox tasks quickly. Sounds boring I know. But it was time well spent and my only regret is not having read it sooner (like 5 years sooner).

Many of the key combinations described therein were familiar friends of mine, but with others I had no acquaintance. I won’t lie to you: a fair number of them are worthless. But others are essential for keyboard-only browsing.

Over the last decade I must have spent ten thousand hours using a web browser. And I don’t think I’m an outlier here. The Web has steamrolled into the twenty-first century and for better or worse become the ubiquitous interface through which the world now wants us to read and write, to listen and speak and to otherwise occupy ourselves.

Let’s say you have to use a web browser just once a day on average for the next 5 years. According to the chart below, even if you can shave off 1 measly second from this daily obligation, it is worth your time to set aside up to 30 minutes today to achieve that daily time saving.

xkcd: Is It Worth the Time?
From xkcd: Is It Worth the Time? (CC BY-NC 2.5).

It takes half a second to move your hand from the typing position to the mouse (or touch pad or whatever) and another half a second to point your cursor at the right spot. Learning a few keyboard shortcuts will surely shave off a few seconds every now and then.

You’ve already wasted 2 minutes reading this page and another 3 staring at that incredibly insightful chart so you’d better get cracking.

I’ve outlined below a few of my favourite shortcuts that comprise my general strategy for keyboard-only navigation, which works better on some sites than others. A good site to practise on is Wikipedia (or, you know, this one). In particular, we will eventually get to the apostrophe key ' which enables lightning fast link following and makes the whole experience much smoother.

You won’t need to go digging through any settings or configuration files to try these; they are built into Firefox and enabled by default.

Learning to use the keyboard as much as possible can be really beneficial to your efficiency and ergonomics when using a computer because it is profoundly more expressive and reliable than any pointing device. If you’re looking to become more proficient with keyboard-driven software but not ready to learn something like Vim or Emacs then this article might be a good stepping stone.

Mozilla have made some increasingly questionable decisions lately, but there are a few privacy-respecting alternatives such as GNU Icecat and Tor Browser which are based on Firefox and have all the same keyboard shortcuts.

The basics

Obviously you can scroll the page screenful-by-screenful using PgUp and PgDn. When the page is in focus, Space and Shift + Space do the same and are more accessible from the home position on full size keyboards. The vertical arrows keys are best reserved for making fine adjustments to the viewport. For jumping to the beginning and end of the page, use Home and End.

Ctrl + Tab and its Shifted equivalent are not unheard of even among novice computer users, but holding Alt and hitting 18 to immediately switch to the corresponding tab will surely impress on-lookers. If you need to switch quickly between adjacent tabs, try Ctrl + PgUp and Ctrl + PgDn.

You probably know Ctrl + w closes the current tab but did you know Ctrl + Shift + W closes the current window? Also essential are Ctrl + t to open a new tab and crucially Ctrl + Shift + T to restore that tab you really wish you hadn’t closed.

Continuing the Shift key theme, I think most people are familiar with Ctrl + r to refresh the page—but hold Shift to clean the cache while doing so.

Of course there are shortcuts like Ctrl + h and Ctrl + b to open the history and bookmarks sidebars, but in practice I rarely use these—instead I use Ctrl + l or Alt + d to bring the address bar into focus and begin searching through history and bookmarks right there. Ctrl + d, however, is really handy for quickly throwing the current page into your bookmarks list—you can then Tab and Shift + Tab around the little dialogue window to make adjustments.

As with most graphical applications, you can generally ‘tab around’ between UI elements and hyperlinks with Tab and Shift + Tab. This is a cumbersome and frustrating way of getting around but it is often necessary. It can be tempting to rely on this in Firefox but think of it as a last resort. In the next section we will learn some faster techniques.

Quick find and navigation

You may know you can hold Alt and use the horizontal arrow keys to go back and forward. Make sure you’re comfortable using them as they’ll become somewhat important later.

Everybody knows Ctrl + f launches the familiar find in page rigmarole, and there is certainly a time and a place for its case sensitive and whole word matching. But in most cases all you need is quick find. Hit forward slash / to begin. It works much the same but is less annoying because it soon gets out of your way; you can still hold Ctrl and hit g and Shift + G to jump between matches, but when you do something else like press Tab or Enter, or even just pause for a few moments, the bar slides away and page focus is restored. I often use this to get back to where I was reading by quick-searching for the short string of words I last read. You can always upgrade to the fully-featured find-in-page mode by hitting Ctrl + f.

By the way, wherever you see an underlined letter in a menu, that means you can hold Alt and hit the corresponding key to activate it. Try toggling Whole Words matching in the find-in-page bar using Alt + w

Finally we are ready to meet the apostrophe key '. This puts you into the same kind of quick search prompt, but results are limited to links only. This is magical. By using Ctrl + g and Ctrl + Shift + G to jump between matches and Enter to follow them, interspersed with the Alt plus arrow key combos mentioned earlier, you can zip around between web pages at light speed with a modicum of keystrokes.

If you follow the wrong link and react before it loads, quickly reach for Esc to cancel it. If you’re too late, remember there’s always Alt + to go back.

When following a focused link with Enter, you can hold Ctrl to make it open in a new tab. It won’t switch to that new tab immediately though; to do that use Ctrl + Shift + Enter instead.

These key commands are great and all, but some rely on page focus; when the address bar or other UI element has keyboard focus, shortcuts like / and ' become inaccessible. Well, get used to hitting F6 to bring focus back to the page itself—you should see a thin black and white dotted rectangle surrounding the page viewport to indicate page focus. Frustratingly F6 actually toggles focus between page and address bar so you can’t always be certain you’ll end up with one or the other without having first hit, say, Ctrl + l or looking for focus clues afterwards.

A word for the wizards

Now, an elite minority among you will no doubt be laughing away from the comfort of one of those Vi-like modal keyboard layer add-ons that grant you web browsing super powers and sing and dance and brew your coffee at the same time. They’re fantastic and I’ve been there. There are even standalone browsers designed around this idea, and they certainly can be worth the time investment. See add-ons Krabby and Vimium; standalone browsers Qutebrowser, Luakit, Nyxt Browser, Vimb, even surf with tabbed and the right combination of patches; and many others. Also worth mentioning are terminal and text-based browsers such as lynx, w3m and EWW. But there are reasons to (and times when you have no choice but to) revert to the bog standard, vanilla, de facto tool.

Also, those keyboard-centric browsers have steep learning curves. They can be dauntingly unfamiliar to new users and behave in unexpected ways to begin with. On the other hand, picking up some of the keyboard-driven techniques outlined above doesn’t mean throwing everything you know about your browser out the window.


To leave a comment, please send a plaintext email to ~chambln/public-inbox@lists.sr.ht and it will show up in my public inbox.