A few days ago, my friend jamessan mentionned on IRC a Firefox extension called Vimperator, an add-on that gives vim-like key bindings to Firefox. I didn’t try it at the time, but when the link was posted on programming.reddit, I decided to give it a try.
It’s an absolutely awesome extension, you use j and k to scroll down and up on a page, Ctrl-F and Ctrl-B are the equivalent of PageDown and PageUp, you can yank the current URL by pressing y and you can delete a tab with d.
The one feature that absolutely blew me away was the QuickHint mode. You press the letter f and all the links in the page have a small “tag” attached to them with a two letter code. Typing that letter code in lower case letters opens the link in the current tab, in upper case letter, the link is opened in a new tab. It’s an absolutely fantastic way to navigate without ever having to reach for the mouse.
As in Vim, you there is a command-line that is accessible by pressing :. The usual commands such as :q, :set, :bd, :h are all available with some more thrown in for browsing. One such command is :open (which you can also launch just by pressing o in command mode). :open gnuvince.net will navigate to this blog. :open gnuvince will perform a search on Google for ‘gnuvince’. :open imdb godfather will do a search on IMDb for ‘godfather’. The documentation doesn’t mention which search engines are supported, I know of Google, IMDb and Wikipedia so far.
Vimperator is not without flaws however. First, since the actions are done with single keys, you lose the ability to use them in applications such as Gmail or Google Reader. Using j and k to go to the next/previous message no longer works, you can’t archive messages by pressing the y key, etc. I’m quite used to those keys, so it’s kind of a drag to reach for the mouse in these cases. I think the problem could be fixed by having an equivalent of insert mode: pressing ‘i’ would make Vimperator ignore the keys (except for Esc to go back to command mode), thus allowing Gmail and other applications to work properly without Vimperator pre-emptively capturing those and performing their actions.
Speaking of keys, the key bindings for Back and Forward are H and L respectively. h and l are used for scrolling a page horizontally. Since it happens way more often that I want to go back than scrolling a page (which almost never happens anymore anyway), I think the bindings should be inverted.
Vimperator also replaces the default status bar with its own vim-like status bar. I have a Gmail pager add-on that displays the number of unread messages in the status bar, so when I use Vimperator, I lose that, so Vimperator effectively renders another add-on useless. Hopefully, future releases of Vimperator will make the status bar visible again. They should probably add that to the ‘guioptions’ setting.
For now, I have disabled Vimperator, but I’m keeping it installed because it’s so cool and I hope that future versions can fix the problems I mentioned.