home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vim42os2.zip / vim-4.2 / doc / vim_rlh.txt < prev    next >
Text File  |  1996-06-18  |  7KB  |  174 lines

  1. *vim_rlh.txt*   For Vim version 4.2.  Last modification: 1996 June 11
  2.  
  3. Right to Left and Hebrew Mapping for Vim        *hebrew*
  4. ========================================
  5.  
  6. These functions have been made by Avner Lottem
  7. E-mail: lottem@tx.technion.ac.il
  8. Phone:  +972-4-8307322
  9.  
  10.  
  11. Introduction
  12. ------------
  13. In order to use right-to-left and Hebrew mapping support, it is necessary to
  14. compile Vim with RIGHTLEFT.  In right-to-left oriented files the characters
  15. appear on the screen from right to left.  This kind of file is most useful
  16. when writing Hebrew documents using TeX--XeT, troffh, composing faxes or
  17. writing Hebrew memos.
  18.  
  19. Logical order files, where direction is encoded for every character (or group
  20. of characters) are not supported as this kind of support is out of the scope
  21. of a simple addition to an existing editor.  Also, no Hebrew commands, prompts
  22. and help files were added, the standard Vi interface was maintained.  The
  23. intension here was to incorporate Hebrew support to an existing modern and
  24. live editor, hoping that the Hebrew support will continue to live in
  25. subsequent versions.  Many other Hebrew supported packages were designed for a
  26. particular version of the original (English) software and when it continued
  27. developing, the Hebrew version stayed behind.  Therefore this particular
  28. support to Vim tries to be as simple (and short) as possible, so that it could
  29. be incorporated into the official source.
  30.  
  31.  
  32. Highlights
  33. ----------
  34. o  Editing left-to-right files as in the original Vim, no change.
  35.  
  36. o  Viewing and editing files in right-to-left windows.   File orientation
  37.    is per window, so it is possible to view the same file in right-to-left
  38.    and left-to-right modes, simultaneously.
  39.    (This is sometimes useful when editing documents with TeX--XeT.)
  40.  
  41. o  Compatibility to the original Vim.   Almost all features work in
  42.    right-to-left mode (see Bugs below).
  43.  
  44. o  Changing keyboard mapping and reverse insert modes using a single
  45.    command.
  46.  
  47. o  Backing from reverse insert mode to the correct place in the file
  48.    (if possible).
  49.  
  50. o  No special terminal with right-to-left capabilities is required.  The
  51.    right-to-left changes are completely hardware independent.  Only
  52.    Hebrew font is necessary.
  53.  
  54.    The MIT X distribution includes at least two fonts: heb6x13 and heb8x13.
  55.    Some fonts are on sunsite.unc.edu: /pub/Linux/X11/fonts/hebxfonts-0.2.tgz.
  56.    More pointers are in the Hebrew HOWTO on sunsite: /pub/Linux/docs/HOWTO.
  57.    To create a Hebrew font for a DOS box under MS-Windows, refer to a hack on
  58.    tochnapc2.technion.ac.il: /pub/lottem/doswin-0.1.tgz.
  59.  
  60. o  ALL enhancements depend on a compilation variable, RIGHTLEFT,
  61.    so it is possible to compile Vim without this support.
  62.  
  63. o  It should be quite easy to adjust this support to handle other right-to
  64.    left languages, such as Arabic, by simply changing the keyboard mapping
  65.    according to the character encoding.
  66.  
  67.  
  68. Change details
  69. --------------
  70. +  Variables:
  71.    +  rightleft (rl) sets window orientation to right-to-left.
  72.    +  hkmap (hk) sets keyboard mapping to Hebrew, in insert/replace modes.
  73.    +  aleph (al), numeric, holds the decimal code of Aleph, for keyboard
  74.       mapping.
  75.  
  76. +  Encoding:
  77.    +  Under Unix, ISO 8859-8 encoding (Hebrew letters codes: 224-250).
  78.    +  Under MS DOS, PC encoding (Hebrew letters codes: 128-154).
  79.    These are defaults, that can be overided using the aleph variable.
  80.  
  81. +  Vim arguments:
  82.    +  'vim -H file' starts editing a Hebrew file, i.e. rightleft and hkmap
  83.       are set.
  84.  
  85. +  Keyboard:
  86.    +  CTRL-_ in insert/replace modes toggles revins and hkmap as follows:
  87.  
  88.       When in rightleft window, revins+nohkmap are toggled, since English
  89.       will likely be inserted in this case.
  90.  
  91.       When in norightleft window, revins+hkmap are toggled, since Hebrew
  92.       will likely be inserted in this case.
  93.  
  94.       CTRL-_ moves the cursor to the end of the typed text, unlike CTRL-B
  95.       that leaves the cursor in the same place.
  96.  
  97.    +  CTRL-_ in command mode only toggles keyboard mapping (see Bugs below).
  98.       This setting is independent of hkmap variable, which only applies to
  99.       insert/replace mode.
  100.  
  101.       Note: On some keyboards, CTRL-_ is mapped to CTRL-?.
  102.  
  103.    +  Keyboard mapping while hkmap is set:
  104.  
  105.         q w e r t y u i o p         The characters in the mapping shown
  106.         / ' ≈ ° α Φ σ ∩ φ ⌠        here are for ISO 8859-8.
  107.  
  108.      a s d f g h j k l ; '
  109.          ∙ π Γ δ ≥ Θ τ ∞ Ω ≤ ,
  110.  
  111.       z x c v b n m , . /
  112.       µ ± ß Σ ≡ ε ÷ · ⌡ .
  113.  
  114.  
  115. Bugs
  116. ----
  117. o  Does not handle CTRL-A and CTRL-X commands (add and subtract)
  118.    correctly when in rightleft window.
  119.  
  120. o  Does not support reverse insert and rightleft modes on the command-line.
  121.    However, functionality of the editor is not reduced, because it is
  122.    possible to enter mappings, abbreviations and searches with Hebrew text,
  123.    typed from the left to the right on the command-line.
  124.  
  125. o  Somewhat slower in right-to-left mode, because right-to-left motion is
  126.    emulated inside Vim, not by the controlling terminal.
  127.  
  128. o  Does not support 7 bit terminals.  Only a terminal with complete
  129.    Hebrew English font (without need to send escape sequences to switch
  130.    between Hebrew and English) is supported.
  131.  
  132. o  When the Athena GUI is used, the bottom scrollbar works in the wrong
  133.    direction.  This is difficult to fix.
  134.  
  135. o  When both 'rightleft' and 'revins' are on: 'textwidth' does not work.
  136.    Lines do not wrap at all; you just get a single, long line.
  137.  
  138.  
  139. Typing backwards                    *ins_reverse*
  140.  
  141. [for all this RIGHTLEFT must have been defined in feature.h at compile time]
  142.  
  143. If the 'revins' (reverse insert) option is set, inserting happens backwards.
  144. This can be used to type Hebrew.  When inserting characters the cursor is not
  145. moved and the text moves rightwards.  A <BS> deletes the character under the
  146. cursor.  CTRL-W and CTRL-U also work in the opposite direction.  <BS>, CTRL-W
  147. and CTRL-U do not stop at the start of insert or end of line, no matter how
  148. the 'backspace' option is set.
  149.  
  150. In Insert mode the 'revins' option can be toggled with CTRL-B.
  151.  
  152. There is no reverse replace mode (yet).
  153.  
  154. If the 'showmode' option is set, "-- REVERSE INSERT --" will be shown in the
  155. status line when reverse Insert mode is active.
  156.  
  157. Reverse Insert mode can be also entered via CTRL-_, which has some extra
  158. functionality: First, keyboard mapping is changed according to the window
  159. orientation -- if in a left-to-right window, revins is used to enter Hebrew
  160. text, so the keyboard changes to Hebrew (hkmap is set); if in a right-to-left
  161. window, revins is used to enter English text, so the keyboard changes to
  162. English (hkmap is reset).  Second, when exiting revins via CTRL-_, the cursor
  163. moves to the end of the typed text (if possible).
  164.  
  165.  
  166. Pasting when in a rightleft window
  167. ----------------------------------
  168.  
  169. When cutting text with the mouse and pasting it in a rightleft window
  170. the text will be reversed, because the characters come from the cut buffer
  171. from the left to the right, while inserted in the file from the right to
  172. the left.   In order to avoid it, toggle revins (by typing CTRL-? or CTRL-_)
  173. before pasting.
  174.