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

  1. *farsi.txt*     For Vim version 5.3.  Last modification: 1998 Aug 17
  2.  
  3.  
  4.           VIM REFERENCE MANUAL    by Mortaza Ghassab Shiran
  5.  
  6.  
  7. Right to Left and Farsi Mapping for Vim        *farsi*
  8.  
  9. {Vi does not have any of these commands}
  10.  
  11. In order to use right-to-left and Farsi mapping support, it is necessary to
  12. compile Vim with the |+farsi| feature.
  13.  
  14. These functions have been made by Mortaza G. Shiran <shiran@jps.net>
  15.  
  16.  
  17. Introduction
  18. ------------
  19. In right-to-left oriented files the characters appear on the screen from right
  20. to left.  This kind of file is most useful when writing Farsi documents,
  21. composing faxes or writing Farsi memos.
  22.  
  23. The commands, prompts and help files are not in Farsi, therefore the user
  24. interface remains the standard Vi interface.
  25.  
  26.  
  27. Highlights
  28. ----------
  29. o  Editing left-to-right files as in the original Vim, no change.
  30.  
  31. o  Viewing and editing files in right-to-left windows.   File orientation is
  32.    per window, so it is possible to view the same file in right-to-left and
  33.    left-to-right modes, simultaneously.
  34.  
  35. o  Compatibility to the original Vim.   Almost all features work in
  36.    right-to-left mode (see bugs below).
  37.  
  38. o  Changing keyboard mapping and reverse insert modes using a single
  39.    command.
  40.  
  41. o  Backing from reverse insert mode to the correct place in the file
  42.    (if possible).
  43.  
  44. o  While in Farsi mode, numbers are entered from left to right. Upon entering
  45.    a none number character, that character will be inserted just into the
  46.    left of the last number.
  47.  
  48. o  No special terminal with right-to-left capabilities is required.  The
  49.    right-to-left changes are completely hardware independent.  Only
  50.    Farsi font is necessary.
  51.  
  52. o  Farsi keymapping on the command line in reverse insert mode.
  53.  
  54. o  Toggling between left-to-right and right-to-left via F8 function key.
  55.  
  56. o  Toggling between Farsi ISIR-3342 standard encoding and VIM Farsi via F9
  57.    function key. Since this makes sense only for the text written in
  58.    right-to-left mode, this function is also supported only in right-to-left
  59.    mode.
  60.  
  61. Farsi Fonts                    *farsi fonts*
  62. -----------
  63.  
  64. Following files are contained in the subdirectories of 'farsi' directory:
  65.  
  66.    +  far-a01.pcf    X Windows fonts for Unix including Linux systems
  67.    +  far-a01.bf     X Windows fonts for SunOs
  68.    +  far-a01.f16    a screen fonts for Unix including Linux systems
  69.    +  far-a01.fon    a monospaced fonts for Windows NT/95/98
  70.    +  far-a01.com    a screen fonts for DOS
  71.  
  72.  
  73. Font Installation
  74. -----------------
  75.  
  76. o  Installation of fonts for MS Window systems (NT/95/98)
  77.  
  78.    From 'Control Panel' folder, start the 'Fonts' program. Then from 'file'
  79.    menu item select 'Install New Fonts ...'. Brows and select the
  80.    'far-a01.fon', then follow the installation guide.
  81.  
  82. o  Installation of fonts for X Window systems (Unix/Linux)
  83.  
  84.    Depending on your system, copy far-a01.pcf.Z or far-a01.pcf.gz into a
  85.    directory of your choice.  Change to the directory containing the Farsi
  86.    fonts and execute the following commands:
  87.  
  88.    >  mkfontdir
  89.    >  xset +fp path_name_of_farsi_fonts_directory
  90.  
  91. o  Installation of fonts for X Window systems (SunOs)
  92.  
  93.    Copy far-a01.bf font into a directory of your choice.
  94.    Change to the directory containing the far-a01.fb fonts and
  95.    execute the following commands:
  96.  
  97.    >  fldfamily
  98.    >  xset +fp path_name_of_fonts_directory
  99.  
  100. o  Installation of ASCII screen fonts (Unix/Linux)
  101.  
  102.    For Linux system, copy the far-a01.f16 fonts into /usr/lib/kbd/consolefonts
  103.    directory and execute the setfont program as "setfont far-a01.f16". For
  104.    other systems (e.g. SCO Unix), please refer to the fonts installation
  105.    section of your system administration manuals.
  106.  
  107. o  Installation of ASCII screen fonts (DOS)
  108.  
  109.    After system power on, prior to the first use of VIM, upload the Farsi
  110.    fonts by executing the far-a01.com font uploading program.
  111.  
  112.  
  113. Usage
  114. -----
  115. Prior to starting VIM, the environment in which VIM can run in Farsi mode,
  116. must be set.  In addition to installation of Farsi fonts, following points
  117. refer to some of the system environments, which you may need to set:
  118. Key code mapping, loading graphic card in ASCII screen mode, setting the IO
  119. driver in 8 bit clean mode ... .
  120.  
  121. o  Setting the Farsi fonts
  122.  
  123.    +  For VIM GUI set the 'guifont' to far-a01. This is done by entering
  124.       ':set guifont=far-a01' in the VIM window.
  125.  
  126.       You can have 'guifont' set to far-a01 by VIM during the VIM startup
  127.       by appending the ':set guifont=far-a01' into your .vimrc file
  128.       (in case of NT/95/98 platforms _vimrc).
  129.  
  130.       Under the X Window environment, you can also start the VIM with
  131.       '-fn far-a01' option.
  132.  
  133.    +  For thr VIM within a xterm, start a xterm with the Farsi fonts (e.g.
  134.       kterm -fn far-a01). Then start the VIM inside the kterm.
  135.  
  136.    +  For VIM under DOS, prior to the first usage of VIM, upload the Farsi
  137.       fonts by executing the far-a01.com fonts uploading program.
  138.  
  139. o  Farsi Keymapping Activation
  140.  
  141.    To activate the Farsi keymapping, set either 'altkeymap' or 'fkmap'.
  142.    This is done by entering ':set akm' or ':set fk' in the VIM window.
  143.    You can have 'altkeymap' or 'fkmap' set as default by appending ':set akm'
  144.    or ':set fk' in your .vimrc file or _vimrc in case of NT/95/98 platforms.
  145.  
  146.    To turn off the Farsi kemapping as a default second language keymapping,
  147.    reset the 'altkeymap' by entering ':set noakm'.
  148.  
  149. o  right-to-left Farsi Mode
  150.  
  151.    By default VIM starts in Left-to-right mode. Following are ways to change
  152.    the window orientation:
  153.  
  154.    + Start the VIM with -F option (e.g. vim -F ... ).
  155.  
  156.    + Use F8 function key to toggle between left-to-right and right-to-left.
  157.  
  158.    + While in Left-to-right mode, enter 'set rl' in the command line ('rl' is
  159.      the abbreviation for rightleft).
  160.  
  161.    + Put the 'set rl' line in your '.vimrc' file to start the  VIM in
  162.      right-to-left mode permanently.
  163.  
  164. Encoding
  165. --------
  166.  
  167. The letter encoding used is the VIM extended ISIR-3342 standard with a built
  168. in function to convert between VIM extended ISIR-3342 and ISIR-3342 standard.
  169.  
  170. For document portability reasons, the letter encoding is kept the same across
  171. different platforms (i.e. UNIX's, NT/95/98, MS DOS, ...).
  172.  
  173.  
  174. o  Keyboard
  175.  
  176.    +  CTRL-_ in insert/replace modes toggles between Farsi(akm)/Latin
  177.       mode as follows:
  178.  
  179.    +  CTRL-_ moves the cursor to the end of the typed text in edit mode.
  180.  
  181.    +  CTRL-_ in command mode only toggles keyboard mapping between Farsi(akm)/
  182.       Latin. The Farsi text is then entered in reverse insert mode.
  183.  
  184.    +  F8 - Toggles between left-to-right and right-to-left.
  185.  
  186.    +  F9 - Toggles the encoding between ISIR-3342 standard and VIM extended
  187.       ISIR-3342 (supported only in right-to-left mode).
  188.  
  189.    +  Keyboard mapping is based on the Iranian ISIRI-2901 standard.
  190.       Following table shows the keyboard mapping while Farsi(akm) mode set:
  191.  
  192.     -------------------------------------
  193.     `  1  2  3  4  5  6  7  8  9  0  -  =
  194.     ó  ▒  ▓  │  ┤  ╡  ╢  ╖  ╕  ╣  ░  ¡  ╜
  195.     -------------------------------------
  196.     ~  !  @  #  $  %  ^  &  *  (  )  _  +
  197.     ~  ú  º  «  ñ  Ñ  ¬  ¼  Φ  ¿  ⌐  Θ  ½
  198.     -------------------------------------
  199.     q  w  e  r  t  z  u  i  o  p  [  ]
  200.     ╙  ╥  ╞  ┘  ╪  ╒  ╓  α  ╩  ╔  ╟  ê
  201.     -------------------------------------
  202.     Q  W  E  R  T  Z  U  I  O  P  {  }
  203.     ≈  ⌡  ⌠  ≤  ≥  ²  ≡  ÷  [  ]  {  }
  204.     -------------------------------------
  205.     a  s  d  f  g  h  j  k  l  ;  '  \
  206.     ╤  ╨  ß  ├  ▄  ┴  ┼  ▐  ▌  ┌  █  δ
  207.     -------------------------------------
  208.     A  S  D  F  G  H  J  K  L  :  "  |
  209.     ∙  √á ■  ·  °  └  ⁿ  µ  τ  ║  ╗  Ω
  210.     -------------------------------------
  211.     <  y  x  c  v  b  n  m  ,  .  /
  212.     ╛  ╫  ╘  ╬  ═  ╠  ╦  ─  ▀  ª  »
  213.     -------------------------------------
  214.     >  Y  X  C  V  B  N  M  <  >  ?
  215.     ╝  ±  ╘  ╧  ═  í  ╦  ┬  ╛  ╝  ┐
  216.     -------------------------------------
  217.  
  218. Note:
  219.     í  stands for Farsi PSP (break without space)
  220.  
  221.     ó  stands for Farsi PCN (for HAMZE attribute )
  222.  
  223. Restrictions
  224. ------------
  225.  
  226. o  In insert/replace mode and fkmap (Farsi mode) set, CTRL-B is not
  227.    supported.
  228.  
  229. o  If you change the character mapping between Latin/Farsi, the redo buffer
  230.    will be reset (emptied). That is, redo is valid and will function (using
  231.    '.') only within the mode you are in.
  232.  
  233. o  While numbers are entered in Farsi mode, the redo buffer will be reset
  234.    (emptied). That is, you can not redo the last changes (using '.') after
  235.    entering numbers.
  236.  
  237. o  While in left-to-right and Farsi mode set, CTRL-R is not supported.
  238.  
  239. o  While in right-to-left mode, the search on 'Latin' pattern does not work,
  240.    except if you enter the Latin search pattern in reverse.
  241.  
  242. o  In the command mode, there is no support for entering the numbers from left
  243.    to right and also for the sake of the flexibility the keymapping logic is
  244.    restricted.
  245.  
  246. o  Under X Window environment, if you want to run the VIM within a xterm
  247.    terminal emulator and Farsi mode set, you need to have an ANSI compatible
  248.    xterm terminal emulator. This is because the letter codes above 128 decimal
  249.    have certain meanings in the standard xterm terminal emulator.
  250.  
  251.    Note: Under X Window environment, VIM GUI works fine in Farsi mode.
  252.      This eliminates the need of any xterm terminal emulator.
  253.  
  254.  
  255. Bugs
  256. ----
  257. While in insert/replace and Farsi mode set, if you repeatedly change the
  258. cursor position (via cursor movement) and enter new text and then try to undo
  259. the last change, the undo will lag one change behind.  But as you continue to
  260. undo, you will reach the original line of text. You can also use U to undo all
  261. changes made in the current line.
  262.  
  263. For more information about the bugs refer to rightleft.txt.
  264.