Start anew
[git/jnareb-git.git] / share / vim / vim58 / doc / rightleft.txt
blobec9fd0fa37f25042f2320e8c75c25b2012999126
1 *rightleft.txt* For Vim version 5.8.  Last change: 1999 Jun 14
4                   VIM REFERENCE MANUAL    by Avner Lottem
7 Right to Left and Hebrew Mapping for Vim                *hebrew*
10 These functions have been made by Avner Lottem
11 E-mail: <alottem@iil.intel.com>
12 Phone:  +972-4-8307322
14 {Vi does not have any of these commands}
16 All this is only available when the |+rightleft| feature was enabled at
17 compile time.
20 Introduction
21 ------------
22 In right-to-left oriented files the characters appear on the screen from right
23 to left.  This kind of file is most useful when writing Hebrew documents using
24 TeX--XeT, troffh, composing faxes or writing Hebrew memos.
26 Logical order files, where direction is encoded for every character (or group
27 of characters) are not supported as this kind of support is out of the scope
28 of a simple addition to an existing editor.  Also, no Hebrew commands, prompts
29 and help files were added, the standard Vi interface was maintained.  The
30 intention here was to incorporate Hebrew support to an existing modern and
31 live editor, hoping that the Hebrew support will continue to live in
32 subsequent versions.  Many other Hebrew supported packages were designed for a
33 particular version of the original (English) software and when it continued
34 developing, the Hebrew version stayed behind.  Therefore this particular
35 support to Vim tries to be as simple (and short) as possible, so that it could
36 be incorporated into the official source.
39 Highlights
40 ----------
41 o  Editing left-to-right files as in the original Vim, no change.
43 o  Viewing and editing files in right-to-left windows.   File orientation
44    is per window, so it is possible to view the same file in right-to-left
45    and left-to-right modes, simultaneously.
46    (This is sometimes useful when editing documents with TeX--XeT.)
48 o  Compatibility to the original Vim.   Almost all features work in
49    right-to-left mode (see Bugs below).
51 o  Changing keyboard mapping and reverse insert modes using a single
52    command.
54 o  Backing from reverse insert mode to the correct place in the file
55    (if possible).
57 o  No special terminal with right-to-left capabilities is required.  The
58    right-to-left changes are completely hardware independent.  Only
59    Hebrew font is necessary.
61    The MIT X distribution includes at least two fonts: heb6x13 and heb8x13.
62    Some fonts are on
63         http://sunsite.unc.edu/pub/Linux/X11/fonts/hebxfonts-0.2.tgz
64    More pointers are in the Hebrew HOWTO on
65         http://sunsite.unc.edu/pub/Linux/docs/HOWTO
66    To create a Hebrew font for a DOS box under MS-Windows, refer to a hack on
67    ftp://tochna.technion.ac.il/pub/staff/lottem/doswin-0.1.tgz.
69 o  It should be quite easy to adjust this support to handle other right-to
70    left languages, such as Arabic, by simply changing the keyboard mapping
71    according to the character encoding.
74 Change details
75 --------------
76 +  Options:
77    +  'rightleft' ('rl') sets window orientation to right-to-left.
78    +  'hkmap' ('hk') sets keyboard mapping to Hebrew, in insert/replace modes.
79    +  'aleph' ('al'), numeric, holds the decimal code of Aleph, for keyboard
80       mapping.
82 +  Encoding:
83    +  Under Unix, ISO 8859-8 encoding (Hebrew letters codes: 224-250).
84    +  Under MS DOS, PC encoding (Hebrew letters codes: 128-154).
85    These are defaults, that can be overridden using the 'aleph' option.
87 +  Vim arguments:
88    +  'vim -H file' starts editing a Hebrew file, i.e. 'rightleft' and 'hkmap'
89       are set.
91 +  Keyboard:
92    +  The 'allowrevins' option enables the CTRL-_ command in Insert mode and
93       in Command-line mode.
95    +  CTRL-_ in insert/replace modes toggles 'revins' and 'hkmap' as follows:
97       When in rightleft window, 'revins' and 'nohkmap' are toggled, since
98       English will likely be inserted in this case.
100       When in norightleft window, 'revins' 'hkmap' are toggled, since Hebrew
101       will likely be inserted in this case.
103       CTRL-_ moves the cursor to the end of the typed text.
105    +  CTRL-_ in command mode only toggles keyboard mapping (see Bugs below).
106       This setting is independent of 'hkmap' option, which only applies to
107       insert/replace mode.
109       Note: On some keyboards, CTRL-_ is mapped to CTRL-?.
111    +  Keyboard mapping while 'hkmap' is set:
113         q w e r t y u i o p             The characters in the mapping shown
114         / ' ÷ ø à è å ï í ô             here are for ISO 8859-8.
116          a s d f g h j k l ; '
117          ù ã â ë ò é ç ì ê ó ,
119           z x c v b n m , . /
120           æ ñ á ä ð î ö ú õ .
123 Bugs
124 ----
125 o  Does not handle CTRL-A and CTRL-X commands (add and subtract)
126    correctly when in rightleft window.
128 o  Does not support reverse insert and rightleft modes on the command-line.
129    However, functionality of the editor is not reduced, because it is
130    possible to enter mappings, abbreviations and searches with Hebrew text,
131    typed from the left to the right on the command-line.
133 o  Somewhat slower in right-to-left mode, because right-to-left motion is
134    emulated inside Vim, not by the controlling terminal.
136 o  Does not support 7 bit terminals.  Only a terminal with complete
137    Hebrew English font (without need to send escape sequences to switch
138    between Hebrew and English) is supported.
140 o  When the Athena GUI is used, the bottom scrollbar works in the wrong
141    direction.  This is difficult to fix.
143 o  When both 'rightleft' and 'revins' are on: 'textwidth' does not work.
144    Lines do not wrap at all; you just get a single, long line.
147 Typing backwards                                        *ins-reverse*
149 If the 'revins' (reverse insert) option is set, inserting happens backwards.
150 This can be used to type Hebrew.  When inserting characters the cursor is not
151 moved and the text moves rightwards.  A <BS> deletes the character under the
152 cursor.  CTRL-W and CTRL-U also work in the opposite direction.  <BS>, CTRL-W
153 and CTRL-U do not stop at the start of insert or end of line, no matter how
154 the 'backspace' option is set.
156 There is no reverse replace mode (yet).
158 If the 'showmode' option is set, "-- REVERSE INSERT --" will be shown in the
159 status line when reverse Insert mode is active.
161 When the 'allowrevins' option is set, reverse Insert mode can be also entered
162 via CTRL-_, which has some extra functionality: First, keyboard mapping is
163 changed according to the window orientation -- if in a left-to-right window,
164 'revins' is used to enter Hebrew text, so the keyboard changes to Hebrew
165 ('hkmap' is set); if in a right-to-left window, 'revins' is used to enter
166 English text, so the keyboard changes to English ('hkmap' is reset).  Second,
167 when exiting 'revins' via CTRL-_, the cursor moves to the end of the typed
168 text (if possible).
171 Pasting when in a rightleft window
172 ----------------------------------
174 When cutting text with the mouse and pasting it in a rightleft window
175 the text will be reversed, because the characters come from the cut buffer
176 from the left to the right, while inserted in the file from the right to
177 the left.   In order to avoid it, toggle 'revins' (by typing CTRL-? or CTRL-_)
178 before pasting.
181 Hebrew characters and the 'isprint' variable
182 --------------------------------------------
184 Sometimes Hebrew character codes are in the none-printable range defined by
185 the 'isprint' variable.  For example in the Linux console, the Hebrew font
186 encoding starts from 128, while the default 'isprint' variable is @,161-255.
187 The result is that all Hebrew characters are displayed as ~x.  To solve this
188 problem, set isprint=@,128-255.
191  vim:ts=8:sw=8:tw=78: