Firefox with vi(m) keybindings

by Juliet Kemp

Browsing through other blogs on here recently, I came across a piece explaining how to set Firefox to use vi key bindings. Which sounded great; unfortunately, the method as advertised no longer works (Firefox

A bit more digging revealed a more up-to-date version. More complicated, as well - you have to unzip [firefox_dir]/chrome/toolkit.jar, edit the platformHTMLBindings.xml file to include the lines

<handler event="keypress" key="h" command="cmd_scrollLeft"/>
<handler event="keypress" key="j" command="cmd_scrollLineDown"/>
<handler event="keypress" key="k" command="cmd_scrollLineUp"/>
<handler event="keypress" key="l" command="cmd_scrollRight"/>
<handler event="keypress" key="u" command="cmd_scrollPageUp" />

and then zip it back up again (keeping the old version for reference is probably wise).

Restarting Firefox and still no joy - any typing still went straight to the 'find ahead' toolbar. Final step, then: open about:config (type 'about:config' in the address bar) and set accessibility:typeaheadfind to false. This does mean you have to type / to start searching but personally my fingers do that automatically anyway so it's not much of a disincentive; and scrolling without needing to move to either arrow keypad or mouse is a definite plus. Now I just need to retrain my hands to do so!


Carla Schroder
2006-04-13 13:06:26
Nice tip, thanks. I wish that good touch-typing was emphasized more, as it's the key to being fast and efficient. But then I guess these days that's no more important than being able to spell and punctuate correctly, and construct reasonably coherent sentences. :)
2006-04-13 15:01:24
Thanks, works for me. Any ideas on how to following a link just using the keyboard? When I hit tab it goes to the top.
Juliet Kemp
2006-04-14 05:33:04
Carla: I agree that touch-typing is very useful. I learnt when I was a kid (my mother would only let me play with the typewriter if I did so 'properly' - was enormously useful as it meant that when I started using keyboards regularly a few years later I automatically touch-typed) & have always been very grateful that I did.

gds: Not sure about keyboard link-following - I'll experiment when I get back to work after Easter (I use Safari on the Mac at home).

2006-04-15 07:51:37
gds: Hitting when focused on a link usually opens the link. Only stumbling block sometimes is when frames are involved (surprise surprise!).

2006-04-15 07:52:25
That was supposed to be 'hitting enter' :/
2006-04-22 06:09:52
wow, that's a great idea. I always found myself hitting j or k in the browser, and then moaning about firefox lack of useful keybindings.

I packaged that stuff in a .xpi extension so I won't have to edit platformHTMLBindings.xml each time there will be a new release of firefox :

I removed 'u' keybindings, and added 'g' and 'G'
but once .xpi installed, you can change it in ~/.mozilla/firefox/yourprofile/extensions/{9d97afa3-bc0a-42a0-b0e1-60272ce39a3e}/chrome/content/vimkeybindings.xml

2006-05-10 23:50:41
Arno is my hero for today. Cheers !
Caitlyn Martin
2006-05-15 14:44:21
Juiet, this is *very* useful. Thanks for posting this.

Carla, I am often shocked how badly people will spell, use improper grammar and punctuation, and write almost incomprehensible stuff and still publish it on the web. Aren't the ashamed of showing the world they can't even use a spell checker? Anyway, you hit on one of my pet peeves. I also get very angry at myself anytime I realize that I've published something with that sort of error that I didn't catch.

2006-06-29 17:32:56
Check out
2007-02-16 07:27:29
Haha, Caitlyn. You actually did make one of those mistakes above.

"Aren't THE ashamed of showing the world they can't even use a spell checker?" instead of THEY. :-)

I am recently out of college 2.5 years ago and could not comprehend why it was so important that I write full coherent sentances on everything. I have now conformed and try to make complete sentances with proper spelling.

When you think about it though, it is really the message that counts. SO, I think that sentance structure, grammar, etc, are important to communicate the right meaning, but spelling and typos should really not matter. SO, I appologize for pointing out the above. Your point is understood, and hopefully so is mine despite its mispellings :-)

Thank You
2007-12-03 00:35:05
Arno and Juliet,

Thank you very much for hosting page about vi keybindings for Firefox. I've been through 3 laptops since I first saw this article. With each new laptop, I download Firefox, crippled by lack of vi keybindings, only to google and find this page yet again.

Thanks so much for hosting this excellent solution, and please never take it offline.