Composing Thunderbird E-Mail with Vi

Do you ever wish you could use the vi text editor to compose e-mail messages while using Thunderbird? If so, then read on:

For my day-to-day e-mail, I use Mutt as my e-mail client and Vim as my editor for composing messages. Most of the time, Mutt’s advantages outweigh its disadvantages (e.g., a plain text e-mail client insulates me from various forms of malware). On occasion, I find that I need to view an HTML-only message or want to check an RSS feed. This is when I fire up Thunderbird. For me, the downside to Thunderbird is that the integrated editor is not vim—my fingers keep reaching for the “i” key and the “Esc” key and I find myself wanting to pipe portions of my messages through various Unix filters such as sort and expand. Rather than wean myself off of vim, I use Alexandre Feblot’s External Editor extension to Thunderbird so I can use gvim (graphical vim) to compose messages while I use Thunderbird. Of course, I could always compose a message in vim and then paste it into the compose window of Thunderbird; however, that’s not nearly as slick. Installation steps below were adapted from the External Editor site and this article.

Prerequisites

  1. Thunderbird and gvim should already be installed on your machine.

Get the External Editor extension

  1. Download the External Editor extension (an .xpi file) to your local machine. (At the time of this post, the downloaded file is named exteditor_v072.xpi.)

Install the Extension

  1. Start Thunderbird
  2. From the menu bar, select Tools –> Extensions and then click “Install”
  3. Browse to your .xpi file and open it; in the window that pops up, click “Install Now”
  4. Quit and then restart Thunderbird so that it picks up the extension.

Configure External Editor to use gvim

  1. From the menu bar, select Tools –> Extensions. Select the External Editor extension and then click “Options.”
  2. In the window that opens enter the text editor information
  3. This step depends on the operating system you are using.
    For Linux:
    Enter “gvim --nofork” in the Text Editor box and adjust the Edit headers section as desired. For example:

    External Editor Settings Window
    For Windows:
    Use the Browse button to find the path to the gvim.exe and then tack on “--nofork” to the end. I used “C:\Program Files\Vim\vim63\gvim.exe --nofork” — note that the nofork option doesn’t seem to have an effect under Windows. I left it there to be consistent with the Linux directions.
  4. Click “OK” to dismiss the External Editor Settings window and then close the Extensions window.

Add the toolbar to the compose window

  1. Open a compose window by clicking on the “Write” icon.
  2. From the menu bar of the Compose window, select View –> Toolbars –> Customize to open a Customize Toolbar window.
  3. Drag and drop the icon for “External Editor” in the Customize Toolbar window to the toolbar of the Compose window.
  4. Dismiss the Customize Toolbar window by clicking the “OK” button
  5. Close the empty compose window and click “Don’t save” in the requestor that pops up

The next time you compose a message, there will be a Gvim icon on the toolbar (in place of the “External Editor” icon) that you can use to edit your message.

Enjoy.

Leave a Reply