home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vim53os2.zip / vim-5.3 / doc / rightleft.txt < prev    next >
Text File  |  1998-08-30  |  7KB  |  179 lines

  1. *rightleft.txt* For Vim version 5.3.  Last modification: 1998 Aug 17
  2.  
  3.  
  4.           VIM REFERENCE MANUAL    by Avner Lottem
  5.  
  6.  
  7. Right to Left and Hebrew Mapping for Vim        *hebrew*
  8.  
  9.  
  10. These functions have been made by Avner Lottem
  11. E-mail: <alottem@iil.intel.com>
  12. Phone:  +972-4-8307322
  13.  
  14. {Vi does not have any of these commands}
  15.  
  16. All this is only available when the |+rightleft| feature was enabled at
  17. compile time.
  18.  
  19.  
  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.
  25.  
  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. intension 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.
  37.  
  38.  
  39. Highlights
  40. ----------
  41. o  Editing left-to-right files as in the original Vim, no change.
  42.  
  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.)
  47.  
  48. o  Compatibility to the original Vim.   Almost all features work in
  49.    right-to-left mode (see Bugs below).
  50.  
  51. o  Changing keyboard mapping and reverse insert modes using a single
  52.    command.
  53.  
  54. o  Backing from reverse insert mode to the correct place in the file
  55.    (if possible).
  56.  
  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.
  60.  
  61.    The MIT X distribution includes at least two fonts: heb6x13 and heb8x13.
  62.    Some fonts are on sunsite.unc.edu: /pub/Linux/X11/fonts/hebxfonts-0.2.tgz.
  63.    More pointers are in the Hebrew HOWTO on sunsite: /pub/Linux/docs/HOWTO.
  64.    To create a Hebrew font for a DOS box under MS-Windows, refer to a hack on
  65.    ftp://tochna.technion.ac.il/pub/staff/lottem/doswin-0.1.tgz.
  66.  
  67. o  It should be quite easy to adjust this support to handle other right-to
  68.    left languages, such as Arabic, by simply changing the keyboard mapping
  69.    according to the character encoding.
  70.  
  71.  
  72. Change details
  73. --------------
  74. +  Variables:
  75.    +  rightleft (rl) sets window orientation to right-to-left.
  76.    +  hkmap (hk) sets keyboard mapping to Hebrew, in insert/replace modes.
  77.    +  aleph (al), numeric, holds the decimal code of Aleph, for keyboard
  78.       mapping.
  79.  
  80. +  Encoding:
  81.    +  Under Unix, ISO 8859-8 encoding (Hebrew letters codes: 224-250).
  82.    +  Under MS DOS, PC encoding (Hebrew letters codes: 128-154).
  83.    These are defaults, that can be overided using the aleph variable.
  84.  
  85. +  Vim arguments:
  86.    +  'vim -H file' starts editing a Hebrew file, i.e. rightleft and hkmap
  87.       are set.
  88.  
  89. +  Keyboard:
  90.    +  The 'allowrevins' option enables the CTRL-_ command in Insert mode and
  91.       in Command-line mode.
  92.  
  93.    +  CTRL-_ in insert/replace modes toggles revins and hkmap as follows:
  94.  
  95.       When in rightleft window, revins+nohkmap are toggled, since English
  96.       will likely be inserted in this case.
  97.  
  98.       When in norightleft window, revins+hkmap are toggled, since Hebrew
  99.       will likely be inserted in this case.
  100.  
  101.       CTRL-_ moves the cursor to the end of the typed text.
  102.  
  103.    +  CTRL-_ in command mode only toggles keyboard mapping (see Bugs below).
  104.       This setting is independent of hkmap variable, which only applies to
  105.       insert/replace mode.
  106.  
  107.       Note: On some keyboards, CTRL-_ is mapped to CTRL-?.
  108.  
  109.    +  Keyboard mapping while hkmap is set:
  110.  
  111.     q w e r t y u i o p        The characters in the mapping shown
  112.     / ' ≈ ° α Φ σ ∩ φ ⌠        here are for ISO 8859-8.
  113.  
  114.      a s d f g h j k l ; '
  115.      ∙ π Γ δ ≥ Θ τ ∞ Ω ≤ ,
  116.  
  117.       z x c v b n m , . /
  118.       µ ± ß Σ ≡ ε ÷ · ⌡ .
  119.  
  120.  
  121. Bugs
  122. ----
  123. o  Does not handle CTRL-A and CTRL-X commands (add and subtract)
  124.    correctly when in rightleft window.
  125.  
  126. o  Does not support reverse insert and rightleft modes on the command-line.
  127.    However, functionality of the editor is not reduced, because it is
  128.    possible to enter mappings, abbreviations and searches with Hebrew text,
  129.    typed from the left to the right on the command-line.
  130.  
  131. o  Somewhat slower in right-to-left mode, because right-to-left motion is
  132.    emulated inside Vim, not by the controlling terminal.
  133.  
  134. o  Does not support 7 bit terminals.  Only a terminal with complete
  135.    Hebrew English font (without need to send escape sequences to switch
  136.    between Hebrew and English) is supported.
  137.  
  138. o  When the Athena GUI is used, the bottom scrollbar works in the wrong
  139.    direction.  This is difficult to fix.
  140.  
  141. o  When both 'rightleft' and 'revins' are on: 'textwidth' does not work.
  142.    Lines do not wrap at all; you just get a single, long line.
  143.  
  144.  
  145. Typing backwards                    *ins-reverse*
  146.  
  147. If the 'revins' (reverse insert) option is set, inserting happens backwards.
  148. This can be used to type Hebrew.  When inserting characters the cursor is not
  149. moved and the text moves rightwards.  A <BS> deletes the character under the
  150. cursor.  CTRL-W and CTRL-U also work in the opposite direction.  <BS>, CTRL-W
  151. and CTRL-U do not stop at the start of insert or end of line, no matter how
  152. the 'backspace' option is set.
  153.  
  154. There is no reverse replace mode (yet).
  155.  
  156. If the 'showmode' option is set, "-- REVERSE INSERT --" will be shown in the
  157. status line when reverse Insert mode is active.
  158.  
  159. When the 'allowrevins' option is set, reverse Insert mode can be also entered
  160. via CTRL-_, which has some extra functionality: First, keyboard mapping is
  161. changed according to the window orientation -- if in a left-to-right window,
  162. revins is used to enter Hebrew text, so the keyboard changes to Hebrew (hkmap
  163. is set); if in a right-to-left window, revins is used to enter English text,
  164. so the keyboard changes to English (hkmap is reset).  Second, when exiting
  165. revins via CTRL-_, the cursor moves to the end of the typed text (if
  166. possible).
  167.  
  168.  
  169. Pasting when in a rightleft window
  170. ----------------------------------
  171.  
  172. When cutting text with the mouse and pasting it in a rightleft window
  173. the text will be reversed, because the characters come from the cut buffer
  174. from the left to the right, while inserted in the file from the right to
  175. the left.   In order to avoid it, toggle revins (by typing CTRL-? or CTRL-_)
  176. before pasting.
  177.  
  178.  vim:ts=8:sw=8:tw=78:
  179.