Right to Left and Hebrew Mapping for Vim


These functions have been made by Avner Lottem
E-mail:lottem@tx.technion.ac.il
Phone: +972-4-8307322

Introduction
In order to use right-to-left and Hebrew mapping support, it is necessary to compile Vim with RIGHTLEFT. In right-to-left oriented files the characters appear on the screen from right to left. This kind of file is most useful when writing Hebrew documents using TeX--XeT, troffh, composing faxes or writing Hebrew memos.

Logical order files, where direction is encoded for every character (or group of characters) are not supported as this kind of support is out of the scope of a simple addition to an existing editor. Also, no Hebrew commands, prompts and help files were added, the standard Vi interface was maintained. The intension here was to incorporate Hebrew support to an existing modern and live editor, hoping that the Hebrew support will continue to live in subsequent versions. Many other Hebrew supported packages were designed for a particular version of the original (English) software and when it continued developing, the Hebrew version stayed behind. Therefore this particular support to Vim tries to be as simple (and short) as possible, so that it could be incorporated into the official source.

Highlights
Change details
Bugs
Typing backwards
[for all this RIGHTLEFT must have been defined in feature.h at compile time]

If the 'revins' (reverse insert) option is set, inserting happens backwards. This can be used to type Hebrew. When inserting characters the cursor is not moved and the text moves rightwards. A <BS> deletes the character under the cursor. CTRL-W and CTRL-U also work in the opposite direction. <BS>, CTRL-W and CTRL-U do not stop at the start of insert or end of line, no matter how the 'backspace' option is set.

In Insert mode the 'revins' option can be toggled with CTRL-B.

There is no reverse replace mode (yet).

If the 'showmode' option is set, "-- REVERSE INSERT --" will be shown in the status line when reverse Insert mode is active.

Reverse Insert mode can be also entered via CTRL-_, which has some extra functionality: First, keyboard mapping is changed according to the window orientation -- if in a left-to-right window, revins is used to enter Hebrew text, so the keyboard changes to Hebrew (hkmap is set); if in a right-to-left window, revins is used to enter English text, so the keyboard changes to English (hkmap is reset). Second, when exiting revins via CTRL-_, the cursor moves to the end of the typed text (if possible).


Send feedback on this page to Rajesh Kallingal
For Vim version 3.24. Last modification: 1996 Apr 25