This 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.
Fig 1: Press Ctrl-E to Launch Vim to 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.
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:
- Select Tools in compose window and then click on External editor which will take you to the vim compose window.
- 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.
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.
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
Comments on this entry are closed.
Its very useful for vim addicts.
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.
@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.
Thanks for this post. It lacked the vim editor in thunderbird
@jrg,
thanks for saving me from my headache 🙂
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.
@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.
gvim –nofork “+set ft=mail” should be sufficient
Followed this exactly but it doesnt work.
Does this work for anyone else using Vim ver 7.3 ?
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…
Why is this plug-in not available officially through Mozilla Thunderbird addons? It would really increase users’ trust.
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.
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’
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.