≡ Menu

Transfer the Power of Vim Editor to Thunderbird for Composing Email

Thunderbird Email LogoThis article is written by SathiyaMoorthy.
 
This article is part of the on-going Vi / Vim Tips and Tricks Series.  In this article, let us review how to use Vim Editor for composing email in Thunderbird.
 
 
External editor Plugin does the magic of composing email in Vi/Vim editor easily, allowing us to utilize all the features of the vim editor without compromising a single thing.
 
 

3 Steps to Install and Configure Thunderbird External editor Plugin

Step 1: Download the thunderbird external editor plugin

Download the thunderbird external editor plugin from globs.org
 
Go to the globs.org download page, click on the external editor which will show the available two versions. Download the right version for you.

  • select & download the version 0.7.4 if you are using thunderbird 2.0.*
  • select & download the version 0.8.0 if you are using thunderbird 3.0.*

Step 2: Install the external editor plugin

Open the Thunderbird, Click on Tools menu, and then select the Add ons and then click the Install button. This will open the local file browser window, select the downloaded file. It will do the installation.

Step 3: Select/Enabling the external editor as VIM

Click on Tools menu, and then select Add Ons, and then select the Preferences of External editor in Add ons Extension window.
 
Enter the “xterm -e vim” in the Text editor input box.

Use the Vi/Vim editor for composing e-mail

Now you are ready to compose your email in vim editor.
 
When you are in the compose window, press CTRL + E it will open the VIM editor as shown in the figure 1. After completing the editing, if you close the editor the content will be shown in the compose window as shown in the figure 3.

Vim Compose Email - Plain Content

 

Fig 1: Press Ctrl-E to Launch Vim to compose email

Vim External Editor - Compose Email

Fig 2: Thunderbird – Composing an email in Vim Editor

 
So after completing composing the mail, save and quit it by :wq , then the edited content will be placed in the compose window as shown in this figure 3.

Vim Compose Email in Thunderbird Editor

Fig 3: Email body from Vim transferred to Thunderbird compose window automatically

 
Note: Until you close the vim editor your compose window will be disabled, and you will be able to work in VIM editor.
 
There are two alternate ways to invoke the vim editor for composing the email:

  1. Select Tools in compose window and then click on External editor which will take you to the vim compose window.
  2. Click on the VIM icon in the compose window. To make the icon available in the compose window, right click on the tool bar, and select customize. Drag and drop the external editor.

Editing the Email Headers

You can toggle between enable/disable header editing by selecting the option in the preferences
window of the external editor.

1. Disable the Header Editing.

Unmark the Edit headers check box in the preferences window.

Vim External Editor Settings Window

Fig 4: Un-check the “Edit headers” check-box to disable editing headers

 
So if you invoke the compose the window, VIM editor will be shown without the mail header as shown in the figure 5.

Vim - Compose Email without external editor

Fig 5: Use VIM editor without the email header

2. Enable the Header Editing.

Select the “Edit headers” check-box option in the Preferences window.
 
By default the header will be enabled. If you invoke the vim editor from compose window you will be able to edit header also.
 

Recommended Reading

Learning the Vi and Vim Editors, by Arnold Robbins. I’m a command-line junkie. So, naturally I’m a huge fan of Vi and Vim editors. Several years back, when I wrote lot of C code on Linux, I used to carry the Vi editor pocket reference with me all the times. Even if you’ve been using Vi and Vim Editors for several years and have not read this book, please do yourself a favor and read this book. You’ll be amazed with the capabilities of Vim editor.

 
This article is part of the ongoing Vi / Vim Tips and Tricks series. Please subscribe to TheGeekStuff and don’t miss any future Vi and Vim editor tips and tricks.
 
This article was written by SathiyaMoorthy, author of 15 Practical Linux Find Command Examples article. The Geek Stuff welcomes your tips and guest articles

Add your comment

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

Comments on this entry are closed.

  • sasikala April 5, 2009, 11:40 pm

    Its very useful for vim addicts.

  • jrg May 6, 2009, 5:03 pm

    One thing I wanted to point out that I had to do to get this to work (Ubuntu 9.04, Thunderbird 2.0.0.21). The “External Editor” button must be added to the compose message frame, or nothing will happen, and the following message will be logged under Tools > Error Console :

    Error: document.getElementById(“exteditor_editAsHtml”) has no properties
    Source File: chrome://exteditor/content/exteditor.js
    Line: 458

    Hope this help someone avoid some headache.

  • Ramesh Natarajan May 8, 2009, 5:42 pm

    @Sasikala,
    Thanks for your comment. Yep. This is good for those Vim addicts who also love Thunderbird.
     
    @jrg,
    Thanks a lot for sharing the issue that you encountered and it’s solution. I’m pretty sure your solution is going to avoid somebody’s headache.

  • Vladimir August 18, 2009, 1:31 am

    Thanks for this post. It lacked the vim editor in thunderbird

  • acevery September 27, 2009, 7:58 pm

    @jrg,
    thanks for saving me from my headache 🙂

  • Paul Brannan December 7, 2009, 12:25 pm

    Nice howto.

    It’s a shame that this technique leaves vim as a second-class citizen. Editing directly in the thunderbird window with gvim would be much cleaner.

  • Putrid Melon January 6, 2010, 9:49 pm

    @sasikala
    But what if I’m not a vim addict? I mean, I use vim, but I don’t think I’m addicted. Do you think this add-on is still useful for me?

    @Paul
    Yeah… *sigh*… If only vim could be a first-class citizen… Being a second-class citizen is no fun. And if only we could have a “much cleaner” way of editing inside the Thunderbird window… cause as they say: cleaner is better. Thanks for your great comment.

  • SR September 12, 2010, 3:10 pm

    gvim –nofork “+set ft=mail” should be sufficient

  • elwoode December 4, 2010, 5:30 am

    Followed this exactly but it doesnt work.
    Does this work for anyone else using Vim ver 7.3 ?

  • Atanu March 28, 2011, 1:07 pm

    Thanks to the author of the plugin. Great Job!

    For gvim and probably other gnome desktops:

    Set “Text Editor” to “gnome-terminal –disable-factory -x gvim -f -u
    NONE”

    Off-course you can do more gymnastics with gnome-terminal and gvim options.

    @Paul and Putrid,
    Rightly said. It would be great if we can replace the built-in editor with our favs. as was the case with the command line email clients. Personally I am happy with the little tid-bits – second hand or otherwise…

  • Ukr June 5, 2011, 1:51 am

    Why is this plug-in not available officially through Mozilla Thunderbird addons? It would really increase users’ trust.

  • Frank August 11, 2011, 5:44 am

    Doesn’t work for me. Tested version 0.9.0 with Icedove 3.1.11. The external editor comes up, but after saving and closing the message, the composing windows doesn’t get updated. However, the edited message file (.eml) can still be found in /tmp — world-readable! Brilliant.

  • ialexs October 25, 2012, 1:14 am

    works for me on thunderbird 16.x
    external editor set as “/usr/bin/gvim –nofork”

    just make sure in your ‘edit’ –> ‘account settings’ –> ‘composition & addressing’ –> uncheck the ‘compose messages in html format’

  • scott baron June 10, 2015, 10:49 am

    Need some help with VIM for Thunderbird. I have Thunderbird 31.7.0 running on my MBP 10.6.8. I installed the application and added the VIM button to the menu. When I invoke it spawns the x11 windowing system. I know this is being processed thorough my ZSHELL as i have OH-MY-ZSH and see errors. I can hit return to continue and I get a terminal window. However the characters are garbled, not to mention so small they can’t be read. Any Suggestions. I love this idea and want to get it running asap. Thank you very much.