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
- Thunderbird and gvim should already be installed on your machine.
Get the External Editor extension
- 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
- Start Thunderbird
- From the menu bar, select Tools –> Extensions and then click “Install”
- Browse to your .xpi file and open it; in the window that pops up, click “Install Now”
- Quit and then restart Thunderbird so that it picks up the extension.
Configure External Editor to use gvim
- From the menu bar, select Tools –> Extensions. Select the External Editor extension and then click “Options.”
- In the window that opens enter the text editor information
- 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:

- 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.
- Click “OK” to dismiss the External Editor Settings window and then close the Extensions window.
Add the toolbar to the compose window
- Open a compose window by clicking on the “Write” icon.
- From the menu bar of the Compose window, select View –> Toolbars –> Customize to open a Customize Toolbar window.
- Drag and drop the icon for “External Editor” in the Customize Toolbar window to the toolbar of the Compose window.
- Dismiss the Customize Toolbar window by clicking the “OK” button
- 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.

June 25th, 2006 at 6:34 am
[…] Here is more detailed description. […]
November 30th, 2006 at 2:40 pm
Coolone dude! Thanks!
December 4th, 2006 at 7:09 am
First, thanks for this nice blog entry!
Also nice is to use the GVIM server/client capability, so you can keep one window open and don’t need to open/close all the time:
- start GVIM with special servername:
$> gvim –servername vimail
- for ‘Text Editor’ use:
gvim –servername vimail –remote-wait-silent
- write your email, save and finish with ‘:bd’
Have fun!
Daniel