Vim for Thunderbird: Muttator extension External Editor extension

Nov 13, 2009

In my quest for the Holy Grail of daily Internet use (IE, how to get vim-style keybindings and modular editing with everything), I finally — at 6 a.m. this morning — was delivered.

Update (11/28/2011): This post is out of date and no longer maintained.

Here are the steps I suggest as a method for recovering control of your keyboard, assuming that you prefer not to use mutt to check multiple IMAP email accounts.

The following will get you vim-style key bindings in Thunderbird and allow you to use vim — or another real text editor — to write your email.  Easier than piecing together a 700 line .muttrc file, I promise!

Step 1: Get Thunderbird Beta 2 and the muttator 0.5 extension

  • Download and install Thunderbird Beta 2: www.mozillamessaging.com/en-US/thunderbird/early_releases/downloads/
  • Download and install the latest nightly build of Muttator 0.5, a beta add-on that lets you control Thunderbird with vim-like keybindings: http://download.vimperator.org/muttator/nightly/
  • Open the muttator*.xpi file with 7-zip (on Windows) or a compression app of your choice on Linux, then edit the file: install.rdf
  • Change the number between the <maxversion></maxversion> tags to: 3.0.*
  • Saveinstall.rdfback intomuttator*.xpi
  • Open Thunderbird, click Tools -> Add-ons
  • Click Install and select muttator’s .xpi file, then restart Firefox
  • You will probably want to view the toolbar (if you want to easily use T-bird’s message search function) and the menu for preferences, so issue the following commands after hitting escape or another escape-mapped key to enter comnand mode:
  • :set guioptions =Tm <Return>
  • :mk! <Return>
  • These two commands enabled the mail toolbar and top menu, then saved that setting in your muttatorc; the command help isn’t available yet, so refer to vimperator’s docs or an earlier version of muttator for help.

    Step 2: Get the External Editor extension and configure it to use vim

  • Download External Editor 0.8, a Thunderbird extension that lets you edit your mail in the text editor of your choice: http://globs.org/download.php?lng=en
  • Open Thunderbird, go to Tools -> Add-ons, Install and choose the exteditor*.xpi file
  • Restart Firefox when directed
  • Go to Tools -> Add-ons -> Extensions, select External Editor, and click Options
  • Enter “vim” or “gvim” if either of those commands are available in your environment, or click Browse to tell External Editor the location of the vim binary
  • Click OK, then close the Options window
  • Issue the m command to write a new message if using muttator, or click the Write button
  • Oddly, a required step: Click View -> Toolbars -> Customize, then drag the External Editor button onto your toolbar (even if you just want to use ^E to open vim)
  • You will probably have to close the window and reopen a write/reply window to see the button correctly, but you should now have a Gvim / Vim button — to edit the mail with Vim, either push the button or hit ^E.

    Step 3: Enjoy the Internet Again

    That should do it!  You can now use vim-like keybindings to browse the web and check your mail, and full on vim to write messages. Aren’t you glad you lived to see this day?

    Follow my posts