Archie Maskill
A software development blog

Vimperator

Being rather keen on Vim and mouseless-ness in general, I was chuffed to discover Vimperator, a Firefox extension for providing a Vim-like interface to web-browsing. If you’re not already familiar with Vim, this may not be an extension you’ll be wanting to try out soon. At least, not until you’re accustomed to and happy with Vim. Or perhaps I’m wrong, and Vimperator will lead you to Vim. That would be weird.

Vim is a modal text editor. This means you flip between two different modes: one for entering text, and one for doing things with the text, such as manipulation and navigation. Learning Vim can be profoundly irritating to learn, because beginners invariably end up typing text whilst in the wrong mode, and wonder why critical pieces of their novel have had the William Burroughs Cut-up Technique applied. In the end, for many people, this infuriation pays off and we find it actually works pretty well for us. I’m really interested to see how a modal web browser will work for me.

Firstly, download the extension from vimperator.mozdev.org (look for it hovering on the right-hand side). After restarting Firefox, you’ll find things look a little different. In the spirit of Vim, the tools and widgets at the top of the brower window will have been hidden. These can be brought back by hitting escape, and typing :set guioptions+=mT (it can be hidden again with :set guioptions-=mT).

To start off the tour, we’ll do a web search in a new window. ‘:wo google.com’ will open a new window and take you to google.com. Do that, then arrange the window such that it can be seen alongside this text.

  • Press f – this places you in QuickHint mode. A small label is placed next to each interactive element on the page. Type the label name for the main Google search box in lower-case. This gives the search box focus. Search for ‘vimperator’.
  • Use j and k to scroll up and down the page. If this is too slow for you, Ctrl-f and Ctrl-b will do this a page at a time. Firefox’s default bindings of spacebar and Shift-spacebar work equally well. gg and G scrolls to the beginning and end of the document, respectively.
  • Follow a link by using the above method.
  • You can return to the previous page by press H. You can move forward through the browser history by pressing L.
  • Follow a link using the above method, but this time enter the label name in upper-case. This causes the page to be loaded in a tab.
  • You can move between tabs using gt and gT.
  • d closes a tab, and u brings it back.
  • t opens a new tab, inviting you to enter a URL in the status bar.
  • ZZ closes the entire browser window.
  • Occasionally, there will be a need to disable Vimperator’s handling of key presses. Pressing I will cause Vimperator to ignore key presses by handing them straight on to the next event handler. GMail is one such service that can require this feature.
  • Vimperator’s search features are exactly as found in Vim: / searches forwards, ? searches backwards. n and N search for the next and previous result, respectively.

Vimperator has quite a bit more to offer than this. I’ve just listed the features that I personally need to browse mouselessly. If you want to learn more about what Vimperator is capable of, type :help. There’s also a mailing list and a wiki.

Advertisements

One Response to “Vimperator”

  1. Excellent article; I tried vimperator prematurely once, and hated it. Prematurely, because while I thought I was comfortable enough with Vim to make good use of the extension, vimperator taught me pretty fast how much in fact I had _avoided_ learning anything about Vim, beyond the most basic navigating and editing, and it made browsing downright intimidating.

    By the way, my own potential RSI problem is not helped at all by these wordpress “Snap”pop-up links things, which make it annoying to open a link in a new page. Why do people use them? Does it generate income? If so, I won’t begrudge your use of them, but they are _very very annoying_.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: