Using Vim with Thunderbird

12:24 Fri 12 Mar 2010. Updated: 19:06 14 Mar 2010
[, , , , ]

It’s possible to get Thunderbird to use Vim as an external editor for email, and while it’s a little clunky, it works.

  1. Get the External Editor add-on for Thunderbird:

    Thunderbird 2: get Version 0.7.4 from this page.

    Thunderbird 3: get Version 0.8.0 from this page.

  2. Install it via the Tools > Add-ons window.
  3. Restart Thunderbird.
  4. Edit the External Editor prefererences via the Tools > Add-ons window.
  5. Enter Vim as the Text Editor (some trickiness for OS X; see below).

That should work—now, in any Compose window, you can hit Control-E (or Command-E for OS X) to invoke Vim as your editor, and it will run Vim editing your email. Saving and then quitting Vim will return you to Thunderbird with the edited message in the Compose menu.

For OS X, the right value for the path to Vim is /Applications/mvim. (mvim is a script for launching Vim that should have come with your MacVim installation.).

This can be improved further, however—if you wish, you can have a Vim instance that’s just for writing email, and you can avoid having to close it every time you’re finished editing. To do this, set the path to your Vim install as /Applications/mvim --servername email --remote-wait. Then open up Terminal and run /Applications/mvim --servername email from the commandline. You now have a Vim instance called “email”, and when you use External Editor in Thunderbird it will open the email in that instance, meaning you don’t have to move or resize the window. Also, instead of quitting Vim, you can save the file and then close it (e.g. :bd), and External Editor will place the contents of the message in your Thunderbird Compose window.

Leave a Reply