linux中vim编辑器_Vim是Linux中Thunderbird的外部编辑器

linux中vim编辑器

Vim is an excellent editor which I use every day. Thunderbird is a nice email application. However, Thunderbird’s integrated editor is not efficient enough to a Vim user. Why not use Vim as Thunderbird’s editor? In this tutorial, we will introduce how to integrate Vim with Thunderbird together in Linux.

Vim是我每天都使用的出色编辑器。 Thunderbird是一个不错的电子邮件应用程序。 但是,Thunderbird的集成编辑器对于Vim用户而言不够高效。 为什么不使用Vim作为Thunderbird的编辑器? 在本教程中 ,我们将介绍如何在Linux中将Vim与Thunderbird集成在一起。

安装“外部编辑器” Thunderbird扩展 (Install the “External Editor” Thunderbird extension)

Download the “External Editor” plugin.

下载“外部编辑器”插件

And install it to Thunderbird.

并将其安装到Thunderbird。

配置外部编辑器 (Configure the external editor)

选项1:使用gvim (Option 1: use gvim)

This is an easy method which use gvim.

这是使用gvim的简单方法。

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

在外部编辑器的首选项中,将文本编辑器设置为:

gvim -f
选项2:在终端中使用vim (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.

如果您喜欢像我一样在终端中使用vim,则可以考虑使用此选项。 在编辑器中设置vim只会失败。

First, create a script “callvim”:

首先,创建一个脚本“ callvim”:

#!/bin/bash

# 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’.

将其保存到$ PATH中的目录中,例如〜/ bin /,并记住通过'chmod + x callvim'将其赋予可执行文件。

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

然后,在“外部编辑器的首选项”中将“文本编辑器”设置为

callvim

如何使用它 (How to use it)

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

在创建或编辑电子邮件时,通过键盘快捷键Ctrl + E调用vim对其进行编辑。

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

在Vim中编辑电子邮件,然后保存并退出。 Thunderbird编辑器中的电子邮件已更改。

自定义Vim以编辑电子邮件 (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.

通过在〜/ .vimrc中设置特定于电子邮件的配置,我们可以将Vim定制为更好的电子邮件编辑器。 下面是我在.vimrc中的配置,该配置将文本宽度设置为68个字符,设置了自动拼写检查,默认文件编码为iso8859-1和utf-8。 也可以使用缩写,在写电子邮件时可能经常使用缩写。

My email configuration in ~/.vimrc

我在〜/ .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!
endfunction

翻译自: https://www.systutorials.com/vim-as-thunderbirds-external-editor-in-linux/

linux中vim编辑器

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值