What is the easiest way to set thunderbird to use with gvim or vim?

Bill Joy taught me how to use "vi" in the 1980s, and being seriously disabled, I made it work. In recent months, though, Ifind that the mutt mailer by itself no longer works.

I do know how to read and write HTML, so I can read and write the kind of I/O required by Thunderbird. What I need to understand is how to make Thunderbird work with vim (or gvim). Is there anyone who can help me with this?


Gary Kline

1 Answer 1


Install the “External Editor” Thunderbird extension from http://globs.org/download.php?lng=en

Configure the external editor.

Option 1: use gvim

This is an easy method which use gvim.

In External Editor’s Preference, set the Text Editor to:

gvim -f

Option 2: use vim in a terminal

If you prefer to use vim in a terminal as me, you may consider this option. Setting vim in the editor will simply fail.

First, create a script “callvim”:


# we need a little trick to use vim inside gnome-terminal.
# Update on Oct. 22, 2013: This trick does not work on gnome-terminal 3.8.4
#   the "--disable-factory" trick does not make the terminal run in foreground.
#   You can use `gvim -f` or `xterm` instead.
# gnome-terminal --geometry=80x40 --disable-factory -e "vim $*"

    # use xterm
    xterm -e vim $*

Save it to a directory in your $PATH, such as ~/bin/, and remember to give it executable by ‘chmod +x callvim’.

Then, set the Text Editor in External Editor’s Preference to


How to use it

When creating or editing email, invoke vim to edit it by the keyboard shortcut Ctrl+E.

Edit the email in Vim and save and exit. The email in Thunderbird’s editor is changed.

Customize Vim for editing email

We can customize Vim to be a better email editor by set email-specific configuration in ~/.vimrc. Below is my configuration in .vimrc which set the text width to 68 charactors, set automatic spell check, default file encoding to be iso8859-1 and utf-8. Abbreviation is also available, which may be frequently used in writing email.

My email configuration in ~/.vimrc:

au FileType mail call FT_mail()

function FT_mail()
    set nocindent
    set noautoindent
    set textwidth=68
    " reformat for 72 char lines
    " normal gggqGgg
    " settings
    setlocal spell spelllang=en
    " setlocal fileencoding=iso8859-1,utf-8
    set fileencodings=iso8859-1,utf-8
    " abbreviations
    iabbr  gd Good Day!

Source: https://www.systutorials.com/3301/vim-as-thunderbirds-external-editor-in-linux/

  • 2
    @Melebius Wow! Lots of work from you. +30 ;-) Pierrely Could you please review Melebius's edits and also review the editing help to improve the readability of your answers in the future... ;-) Melebius just made you earn 10 reputation! ;-)
    – Fabby
    Jul 19, 2019 at 7:28
  • ok (next time - <grin>) , thanks Melebius.
    – pierrely
    Jul 20, 2019 at 6:07
  • Sounds good! But apparently it's not compatible with Thunderbird 68.7.0. Are there any alternatives?
    – MaxGyver
    May 8, 2020 at 21:49
  • I've found the latest version of that plugin: github.com/exteditor/exteditor/releases/latest
    – MaxGyver
    May 9, 2020 at 6:34
  • The latest release isn't compatible with Thunderbird 90.2.0 😞 Oct 25, 2021 at 13:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .