文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>How to use Vim with Firefox and Thunderbird

How to use Vim with Firefox and Thunderbird

时间:2006-11-13  来源:runsnake

How to use Vim with Firefox and Thunderbird

From Text

This article covers how to install the ViewSourceWith extension for the Firefox browser and configure it to use your notepad of choice to edit text fields.

To do this, follow these steps:

Contents

  • Install the ViewSourceWith extension

  • Configuring the ViewSourceWith extension

  • Adding Gvim as an editor

  • Editing a text field with Gvim

  • Adding vim as an editor


Install the ViewSourceWith extension

Download the ViewSourceWith extension and install it. If you see a message like this one

To protect your computer, Firefox prevented this site (prdownloads.sourceforge.net) from installing software on your computer.

below your tab in Firefox, you need to click the Edit Options button on the right of the tap, then click Allow in the pop up window. This enables you to install extensions hosted at Sourceforge.

After installing the ViewSourceWith extension, close all Firefox windows, and restart the browser.


Configuring the ViewSourceWith extension

In the Firefox tool bar, click the Tools menu, then the Extensions option. This opens a list of the extensions you have installed.

Right click the ViewSourceWith entry and select the Preferences (or Options) option. Alternatively select the ViewSourceWith option and and click the Preferences (or Options) button at the bottom of the window.

This opens the ViewSourceWith preference window. You can leave most of the defaults here.


Adding Gvim as an editor

To add an editor to ViewSourceWith, in the first tab of the preferences window, click the New button with a yellow plus sign on it.

In the Editor Path field enter

/usr/bin/gvim

And in the Description field, enter something memorable, like

Gvim Text Editor

Ignore the shortcut for the moment, and click the OK button. Your new Gvim entry will be listed, and will have a blue arrow to the right of the name, indicating that it is enabled.

Note: You can use a path and description for your own editor here, or even add a few if you prefer a choice.


Editing a text field with Gvim

To edit a text fields with Gvim, open a form in your browser, right click inside the form, and in the ViewSourceWith option, select Gvim Text Editor.

This opens a Gvim session with the contents of the form (or blank if the form was blank). Edit to your hearts content, and simply save and exit when you are done.

Job Done.


Adding vim as an editor

The same procedure for gvim applies for vim, with the difference that vim needs a terminal to work with. So writing /usr/bin/vim in path above won't work as you might expect.

Instead, we want to open a terminal that has vim inside.

For users of aterm:

Editor Path: /usr/bin/aterm
Parameters: -e vim $f

=====================================================

External Editor:edit mail in your prefered editor

Purpose

Allows to open and edit your messages in an external text editor such as NEdit, emacs, etc...

Installation

The External Editor button is not visible by default; you must customize your composer toolbar:
  • Open the compose window
  • Select the menu View/Toolbars/Customize..., or right click on the toolbar and select Customize...
  • Drag and Drop the new icon External Editor on your toolbar
  • Click OK
Then, open the extension option window and set your editor (without path or with an absolute path)

Usage

Just click on the extension button or use the keyboard shortcut (Ctrl-E), edit your message in your editor (while editing, the compose window is disabled), save, close, and the message will be updated in the compose window.

HTML Edition

When editing a HTML message, the External Editor button provides a drop-down menu allowing to edit as HTML (thus keeping all text enhancements), or as plain text.

Unicode support

Starting with version 0.6, unicode is supported. You must set unicode encoding in the Compose window before launching External Editor: Menu Options/Character Encoding: Unicode (UTF-8).

Headers Edition

Headers can be edited in the external editor, given as a comma separated list in a paragraph before the message content.

Supported headers are: Subject, To,Cc, Bcc, Reply-To, Newsgroup.

Subject: Here is the subject
To: adressTo1, adressTo2
Cc: adressCc1
Bcc:
Reply-To:
-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-
... the mail content begins here ...

But you can then modify it, use multiple lines, and add as many headers type as you want. Example:

To: adresseTo1, adresseTo2
adresseTo3
adresseTo4, adresseTo5
Cc: adresseCc1
adresseCc2, adresseCc3
To:adresseTo6
To:adresseTo7
...
-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-

Warnings

  • Your external editor must run in foreground, i.e. must not return before you close the file.
    • NEdit: use "nedit" or "nc -wait"
    • gvim: use "gvim --nofork"
    • and for vim: use "xterm -e vim"
  • External Editor has been tested on Windows (XP) and Linux. It also works on Mac OSX, beginning with Thunderbird 1.1. Previous versions of Thunderbird could not use External Editor because of Mozilla bug 267269.

排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载