rileft.txt 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. *rileft.txt* Nvim
  2. VIM REFERENCE MANUAL by Avner Lottem
  3. updated by Nadim Shaikli
  4. Right to Left display mode for Vim *rileft*
  5. These functions were originally created by Avner Lottem:
  6. E-mail: alottem@iil.intel.com
  7. Phone: +972-4-8307322
  8. ------------------------------------------------------------------------------
  9. Introduction
  10. Some languages such as Arabic, Farsi, Hebrew (among others) require the
  11. ability to display their text from right-to-left. Files in those languages
  12. are stored conventionally and the right-to-left requirement is only a
  13. function of the display engine (per the Unicode specification). In
  14. right-to-left oriented files the characters appear on the screen from
  15. right to left.
  16. Bidirectionality (or bidi for short) is what Unicode offers as a full
  17. solution to these languages. Bidi offers the user the ability to view
  18. both right-to-left as well as left-to-right text properly at the same time
  19. within the same window. Vim currently, due to simplicity, does not offer
  20. bidi and is merely opting to present a functional means to display/enter/use
  21. right-to-left languages. An older hybrid solution in which direction is
  22. encoded for every character (or group of characters) are not supported either
  23. as this kind of support is out of the scope of a simple addition to an
  24. existing editor (and it's not sanctioned by Unicode either).
  25. ------------------------------------------------------------------------------
  26. Highlights
  27. o Editing left-to-right files as in the original Vim, no change.
  28. o Viewing and editing files in right-to-left windows. File orientation
  29. is per window, so it is possible to view the same file in right-to-left
  30. and left-to-right modes, simultaneously. (Useful for editing mixed files
  31. in which both right-to-left and left-to-right text exist).
  32. o Compatibility to the original Vim. Almost all features work in
  33. right-to-left mode (see Bugs below).
  34. o Backing from reverse insert mode to the correct place in the file
  35. (if possible).
  36. o No special terminal with right-to-left capabilities is required. The
  37. right-to-left changes are completely hardware independent.
  38. o Many languages use and require right-to-left support. These languages
  39. can quite easily be supported given the inclusion of their required
  40. keyboard mappings and some possible minor code change. Some of the
  41. current supported languages include - |arabic.txt| and |hebrew.txt|.
  42. ------------------------------------------------------------------------------
  43. Of Interest...
  44. o Invocations
  45. + 'rightleft' ('rl') sets window orientation to right-to-left.
  46. + 'delcombine' ('deco'), boolean, if editing UTF-8 encoded languages,
  47. allows one to remove a composing character which gets superimposed
  48. on those that preceded them (some languages require this).
  49. + 'rightleftcmd' ('rlc') sets the command-line within certain modes
  50. (such as search) to be utilized in right-to-left orientation as well.
  51. o Typing backwards *ins-reverse*
  52. In lieu of using the full-fledged 'rightleft' option, one can opt for
  53. reverse insertion. When the 'revins' (reverse insert) option is set,
  54. inserting happens backwards. This can be used to type right-to-left
  55. text. When inserting characters the cursor is not moved and the text
  56. moves rightwards. A <BS> deletes the character under the cursor.
  57. CTRL-W and CTRL-U also work in the opposite direction. <BS>, CTRL-W
  58. and CTRL-U do not stop at the start of insert or end of line, no matter
  59. how the 'backspace' option is set.
  60. There is no reverse replace mode (yet).
  61. If the 'showmode' option is set, "-- REVERSE INSERT --" will be shown
  62. in the status line when reverse Insert mode is active.
  63. o Pasting when in a rightleft window
  64. When cutting text with the mouse and pasting it in a rightleft window
  65. the text will be reversed, because the characters come from the cut buffer
  66. from the left to the right, while inserted in the file from the right to
  67. the left. In order to avoid it, toggle 'revins' before pasting.
  68. ------------------------------------------------------------------------------
  69. Bugs
  70. o Does not handle CTRL-A and CTRL-X commands (add and subtract) correctly
  71. when in rightleft window.
  72. o Does not support reverse insert and rightleft modes on the command-line.
  73. However, functionality of the editor is not reduced, because it is
  74. possible to enter mappings, abbreviations and searches typed from the
  75. left to the right on the command-line.
  76. o Somewhat slower in right-to-left mode, because right-to-left motion is
  77. emulated inside Vim, not by the controlling terminal.
  78. o When both 'rightleft' and 'revins' are on: 'textwidth' does not work.
  79. Lines do not wrap at all; you just get a single, long line.
  80. o There is no full bidirectionality (bidi) support.
  81. vim:tw=78:ts=8:noet:ft=help:norl: