rileft.txt 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. Introduction
  9. ------------
  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. Highlights
  26. ----------
  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. Of Interest...
  43. --------------
  44. o Invocations
  45. -----------
  46. + 'rightleft' ('rl') sets window orientation to right-to-left.
  47. + 'delcombine' ('deco'), boolean, if editing UTF-8 encoded languages,
  48. allows one to remove a composing character which gets superimposed
  49. on those that preceded them (some languages require this).
  50. + 'rightleftcmd' ('rlc') sets the command-line within certain modes
  51. (such as search) to be utilized in right-to-left orientation as well.
  52. o Typing backwards *ins-reverse*
  53. ----------------
  54. In lieu of using the full-fledged 'rightleft' option, one can opt for
  55. reverse insertion. When the 'revins' (reverse insert) option is set,
  56. inserting happens backwards. This can be used to type right-to-left
  57. text. When inserting characters the cursor is not moved and the text
  58. moves rightwards. A <BS> deletes the character under the cursor.
  59. CTRL-W and CTRL-U also work in the opposite direction. <BS>, CTRL-W
  60. and CTRL-U do not stop at the start of insert or end of line, no matter
  61. how the 'backspace' option is set.
  62. There is no reverse replace mode (yet).
  63. If the 'showmode' option is set, "-- REVERSE INSERT --" will be shown
  64. in the status line when reverse Insert mode is active.
  65. o Pasting when in a rightleft window
  66. ----------------------------------
  67. When cutting text with the mouse and pasting it in a rightleft window
  68. the text will be reversed, because the characters come from the cut buffer
  69. from the left to the right, while inserted in the file from the right to
  70. the left. In order to avoid it, toggle 'revins' before pasting.
  71. Bugs
  72. ----
  73. o Does not handle CTRL-A and CTRL-X commands (add and subtract) correctly
  74. when in rightleft window.
  75. o Does not support reverse insert and rightleft modes on the command-line.
  76. However, functionality of the editor is not reduced, because it is
  77. possible to enter mappings, abbreviations and searches typed from the
  78. left to the right on the command-line.
  79. o Somewhat slower in right-to-left mode, because right-to-left motion is
  80. emulated inside Vim, not by the controlling terminal.
  81. o When both 'rightleft' and 'revins' are on: 'textwidth' does not work.
  82. Lines do not wrap at all; you just get a single, long line.
  83. o There is no full bidirectionality (bidi) support.
  84. vim:tw=78:ts=8:noet:ft=help:norl: