Friday, May 21, 2010

Mouseless Browsing

Once you write a book, you become really immersed in the subject matter. After it's off to the publisher, you can't turn off your interest in the subject. Consequently, after The Productive Programmer came out, I continue to find new ways to make myself more productive. One of my recent tendencies is mouseless browsing.

I have a love/hate affair with Firefox. I love the keyboard affordances it provides, especially the slash ("/") and apostrophe ("'") shortcuts. When looking at a web page, the slash starts an incremental find for text within the page. The apostrophe does something similar, but it restricts the matches to URLs only. How many times do you go to a web site and you know the name of the link you want already? For example, if I need to go to the ThoughtWorks web site to get the address of the London location (this happened earlier today), I know (or can guess) that there is a "Contact" link on the home page, which takes me to a list of offices. In my new mouseless browsing mode, I go to the home page thoughtworks.com, hit the apostrophe and start typing "contact", hit enter and now I'm on the contact page. From there, I can hit the slash key and start typing "London". I've found my address and never taken my fingers off the home row. This added to the spacebar to scroll down and shift-spacebar to scroll up and you can get a lot done in a browser without a mouse.

I maintain a love/hate relationship because one of the cool things about Firefox is all the plug-ins available. Conversely, one of the things I hate about Firefox are all the plug-ins! I tend to find useful plug-ins and add them, which adds to the weight (and start up time) for the whole browser. Recently, I stumbled across Camino, which uses the same rendering engine as Firefox, which means that my 2 favorite keyboard shortcuts work. Camino is very lightweight (if "feels" lighter than Safari) and it supports my browsing habits. This is going to sound odd, but one of the critical things that it supports is the ability to type a partial URL in the address bar (which it will auto-complete) and hit CTRL-N to move the cursor down to the first (or subsequent) matches. This is a big deal for me because the Emacs key bindings are deeply ingrained in my fingers (and most of OS X, as it turns out), but Firefox doesn't allow this. Firefox has apparently overwritten the CTRL-N key to do nothing (overriding the operating system). While this sounds minor, it bites me every time. Fortunately, Camino adheres to the Apple standard, allowing me to have my cake (having CTRL-N move down one line, as it was Meant To Be) and keyboard-driven browsing.

If you really want to go far down this path, there is the Conkeror browser. It's "About:"

Conkeror is a keyboard-oriented, highly-customizable, highly-extensible web browser based on Mozilla XULRunner, written mainly in JavaScript, and inspired by exceptional software such as Emacs and vi. Conkeror features a sophisticated keyboard system, allowing users to run commands and interact with content in powerful and novel ways. It is self-documenting, featuring a powerful interactive help system.

I have played with Conkeror and it has strong promise, but it's not quite mature enough for me to switch to daily use.

And if you are a Vim junkie, you can use the Firefox plugin called vimperator, which converts Firefix to a purely vi interface. Not for the faint of heart: if you don't know how to quit Vim, you're going to have a tough time with vimperator. Hard-core Vim-mers swear by this, but I'm too far gone down the Emacs route now to re-map the genes in my fingertips.

Mouseless browsing takes acclimatization, but once you become accustomed to it, you'll start finding it annoying to reach for a mouse (or even for the arrow keys -- not the home row!). This is why I have no interest in Chrome for now because it doesn't support my normal mode of browsing.