Chad Perrin: SOB

20 October 2009

So, I started using Vimperator for real this time. . . .

Filed under: Geek — apotheon @ 03:11

A while back — months, maybe a year or so — I tried installing the Vimperator extension for Firefox. I played around with it for maybe three minutes or so, then decided I should get back to work and turned off the extension rather than slow down my work by trying to learn how to use Vimperator.

The problem is that Vimperator completely changes the way the browser works, making it an entirely keyboard-driven application. Yes, you can still use the mouse if you really want to, but a lot of stuff becomes much more difficult to accomplish (if not nearly impossible) with a mouse instead of the keyboard. As such, the learning curve seems steep at first, and it felt a bit much for me at that exact moment. I figured I’d get back to it later.

I never did get back to it. Time passed. I moved to a new laptop, where it wasn’t even installed in the first place, and had long since basically forgotten about Vimperator. Then, last week, I felt inspired to give it another try.

I’ve started using Vimperator for real this time. To my surprise, it took me all of about five minutes to get comfortable enough with it to use it for my everyday browsing tasks without feeling like I was substantially hampered. By the time I had spent ten minutes with it, while some things still didn’t come as easily for me with Vimperator as without it, other things were easier, so that instead of being more difficult to use effectively than Firefox without the extension it was just a trade-off. By the time I had spent half an hour using it, Vimperator was turning out to give me a slight boost to the efficiency and “naturalness” of the browsing experience for me, in the same way that — once one gets past the initial learning curve hump — vi/Vim enhances one’s productivity when editing text files.

Part of the key to quick familiarization and comfort with Vimperator was, I’m sure, my familiarity and comfort with Vim. Another part is the help page that Vimperator opens the first time the browser is restarted after the Vimperator extension is installed. That help page is just a Web page (actually a handful of Web pages that link to each other) stored on the local system, “installed” there along with Vimperator itself. Don’t worry about closing it and losing track of it; Vimperator allows you to open it up again simply by way of the :help command. Nothing to it.

I’ve added the NumExt extension for Firefox after getting used to Vimperator. It does nothing but add simple text numbers to all open tabs and add some (ignorable) keybindings to allow switching between tabs. The keybindings are incredibly limited, but I don’t much care about that. The reason I wanted numbered tabs was simply to allow me to type 60gt (for instance) to immediately go to tab number 60. Vimperator allows me to do this by default of course, but if I don’t know the numbers of the tabs it makes it somewhat more difficult to magically pluck the number for the desired tab out of thin air. Since I tend to browse with a lot of tabs open (sometimes more than 150; currently 74 of them), this — Vimperator + NumExt — is a very useful combination. I don’t have to count to know that the tab to which I want to switch is six to the left of the current tab before typing 6gT any longer (or, worse, just hit gT over and over again). Instead, I type 60gt and go directly there (for instance, again).

(NOTE: An anonymous commenter below mentioned that a simple configuration option would add numbers to tabs, so I don’t need the NumExt extension. It works well. Setting it within the current Vimperator browsing sessions can be accomplished by using the :set go+=n command, which adds the n option to whatever other options you already have set. To save options to the configuration file, use the :mkv command.)

I got rid of the View Source With extension, which I used to let me open a text area on a Web form in an external editor (Vim in a terminal emulator window, naturally), when I realized that when the cursor is in a Web form text area I can just hit <Ctrl>+<I> to open an instance of a Vim-like editor to edit the contents of the text area, thus making View Source With redundant for me.

When using :open or :tabopen (depending on whether I want to open something in the current tab or a new tab, respectively), it’s probably worth knowing you can use tab completion to get the same effects as using the address bar’s suggestions. Start typing something like :open sob.apo then hit the Tab key, and you should get a bunch of suggestions for how to finish that URL just as you’d get suggestions for how to finish it if typed in the normal Firefox address bar. Cycle through them with the Tab key, just as you would if you were using tab completion at a Unix shell, and hit the Enter key when you’ve selected the correct URL. As long as you aren’t in Insert mode, you can use either the O key or the T key, respectively, to get :open or :tabopen started. Following that, just type in the beginning of the URL you want, and hit <Tab> to get your tab completion.

To copy the URL of the current tab into the clipboard, just type y (again, when not in Insert mode). It’s much easier than having to move my hand to the mouse and highlight the URL in the address bar.

Anyway . . . the point is that, after using it for a a month or so, I think Vimperator is great. Your mileage may vary, I suppose.


  1. You can get rid of the tab numbering extension:

    :set go=n

    Comment by Anonymnous — 21 October 2009 @ 09:36

  2. Yeah, sometimes a bad first impression with a program will just disappear if you give yourself a break. I feel that way all the time, even though I’ve never actually used Vimperator.

    Comment by Manhattan — 21 October 2009 @ 10:00

  3. Anonymous:

    Thanks! I’ve taken your advice, and it does indeed work.


    I didn’t actually have a bad first impression, exactly, with Vimperator. I just thought I didn’t have time to learn to use it effectively, and ended up not giving myself time to have any kind of impression — then forgot about it. Still, you’re right: we should give software a real chance before deciding it isn’t worth the time.

    I let the notion that I didn’t have the time to waste stop me from giving FreeBSD a real try for a couple of years, then when I finally did give it a try I liked it so much it became my new favorite OS. It was the same problem as with Vimperator, basically. One would think that would have taught me to give some new software a real try when the opportunity arose, but I managed to put off giving Vimperator a real try anyway. I’m just glad I eventually got around to giving it a real shot.

    Comment by apotheon — 21 October 2009 @ 10:27

  4. You don’t need to use gt and gT to change tabs. You can just use Ctrl-n and Ctrl-p. Much easier, but I didn’t find about it until at least 6 months of using vimperator.

    Comment by Jason — 21 October 2009 @ 07:51

  5. You might want the binding for ‘b’ to navigate tabs. Press b, type a few characters, press enter, and get taken to the first tab whose title contains that substring. bface and there’s Facebook, etc.

    Macros are completely awesome too.

    Comment by shepheb — 22 October 2009 @ 06:29

  6. Jason:

    I prefer not having to move my hands from home row. The Ctrl key isn’t too far, but gt is a lot closer than Ctrl-p, and it’s the same number of keystrokes.


    If I find myself desiring that functionality at some point, I’ll look into it. Thanks for the tip.

    Comment by apotheon — 22 October 2009 @ 09:48

  7. The numbered tabs is great. I use the b key to navigate. 60b jumps to that buffer(tab). I just started using vimperator, and am already feeling superior to all those tied to their mouse. :-)

    Having this functionality in Firefox, has encouraged me to really dig into vim for editing on the servers that I deal with.

    Comment by AustinDev — 12 November 2009 @ 07:34

  8. How do you clear the command line history in Vimperator?

    I’ve been using Vimperator off and on, but some of the key bindings don’t seem right to me coming from Vim.

    Comment by td — 18 December 2009 @ 04:04

  9. Hey, sorry I didn’t remember to respond to this earlier.

    I don’t think there’s really a way to clear the command line history. I’m not even aware of one in Vim, per se — but if you know of one please tell me. It can be turned on or off, or set to an arbitrary maximum number of lines that Vim will remember, using the Vim configuration file — and the same may be true of vimperator. I don’t know of any way to clear the history short of closing the browser and reopening it, though.

    Keybindings can be changed for vimperator. use the :help command in vimperator to learn more about that, I guess.

    Comment by apotheon — 28 December 2009 @ 12:39

  10. Personally, have remapped J and K to and . These keys were going to waste and are right on the home row. This way it is easy to run through a bunch of tabs very quickly (gt requires two keypresses and is tedious for getting through a bunch of tabs).

    Comment by Mike — 7 April 2010 @ 08:43

  11. Hm, the comments box ate up some commands as tags. I remapped J and K to Ctrl-N and Ctrl-P.

    Comment by Mike — 7 April 2010 @ 08:44

  12. Good point, re: gt. Of course, I also use j and k for moving up and down a webpage a little at a time, so I don’t really want to give them up for moving through tabs.

    Comment by apotheon — 8 April 2010 @ 06:59

  13. Apotheon: I think what Mike is saying is that he remapped J and K to the control sequences; not j and k. Case-sensitivity, baby! :)

    Comment by John — 29 July 2010 @ 07:25

  14. Ah. I would have expected that to be Shift-J and Shift-K, since the keys say J and K on them (not j and k).

    Comment by apotheon — 14 August 2010 @ 05:16

  15. Pretty much my exact adoption process. Now I’ve fully customized vp with a _vimperatorrc. I need to figure out how to do macros and get it to read a javascript file. Haven’t quite figured that out yet. ~lee

    Comment by leeleblanc — 29 August 2010 @ 10:10

  16. Do you have any useful tips or tricks for your vimperatorrc file that might be worth sharing?

    Comment by apotheon — 2 September 2010 @ 08:23

  17. Sure thing! I’ll fire my _vimperatorrc off in an email. Last night, following the post below I made the readability.js plugin work (on Windows XP). But today, I am using Portable FF on Windows 7 to move between home and work computers. And alas, it’s not working.

    link to post:

    Comment by leeleblanc — 2 September 2010 @ 01:32

  18. I don’t think I ever received that email, by the way.

    Comment by apotheon — 9 September 2010 @ 09:22

  19. Weird- did you get the one I just sent?

    Comment by leeleblanc — 9 September 2010 @ 12:01

  20. Yes, I got it (and replied), and found the previous email with the vimperatorrc attached where it was hiding in one of the nooks and crannies of my email management. Sorry about that.

    Comment by apotheon — 10 September 2010 @ 10:46

  21. […] extension that provides vi-like keybindings, covering at least a significant subset of the reasons I use the Vimperator extension for Firefox. Of course, your mileage may […]

    Pingback by Chromium Browser on FreeBSD lacks only the right set of extensions | Linux and Open Source | — 1 November 2010 @ 08:17

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

All original content Copyright Chad Perrin: Distributed under the terms of the Open Works License