mbyte.txt 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114
  1. *mbyte.txt* Nvim
  2. VIM REFERENCE MANUAL by Bram Moolenaar et al.
  3. Multi-byte support *multibyte* *multi-byte*
  4. *Chinese* *Japanese* *Korean*
  5. This is about editing text in languages which have many characters that can
  6. not be represented using one byte (one octet). Examples are Chinese, Japanese
  7. and Korean. Unicode is also covered here.
  8. For an introduction to the most common features, see |usr_45.txt| in the user
  9. manual.
  10. For changing the language of messages and menus see |mlang.txt|.
  11. Type |gO| to see the table of contents.
  12. ==============================================================================
  13. Getting started *mbyte-first*
  14. This is a summary of the multibyte features in Vim. If you are lucky it works
  15. as described and you can start using Vim without much trouble. If something
  16. doesn't work you will have to read the rest. Don't be surprised if it takes
  17. quite a bit of work and experimenting to make Vim use all the multi-byte
  18. features. Unfortunately, every system has its own way to deal with multibyte
  19. languages and it is quite complicated.
  20. LOCALE
  21. First of all, you must make sure your current locale is set correctly. If
  22. your system has been installed to use the language, it probably works right
  23. away. If not, you can often make it work by setting the $LANG environment
  24. variable in your shell: >
  25. setenv LANG ja_JP.EUC
  26. Unfortunately, the name of the locale depends on your system. Japanese might
  27. also be called "ja_JP.EUCjp" or just "ja". To see what is currently used: >
  28. :language
  29. To change the locale inside Vim use: >
  30. :language ja_JP.EUC
  31. Vim will give an error message if this doesn't work. This is a good way to
  32. experiment and find the locale name you want to use. But it's always better
  33. to set the locale in the shell, so that it is used right from the start.
  34. See |mbyte-locale| for details.
  35. ENCODING
  36. Nvim always uses UTF-8 internally. Thus 'encoding' option is always set
  37. to "utf-8" and cannot be changed.
  38. All the text that is used inside Vim will be in UTF-8. Not only the text in
  39. the buffers, but also in registers, variables, etc.
  40. You can edit files in different encodings than UTF-8. Nvim
  41. will convert the file when you read it and convert it back when you write it.
  42. See 'fileencoding', 'fileencodings' and |++enc|.
  43. DISPLAY AND FONTS
  44. If you are working in a terminal (emulator) you must make sure it accepts
  45. UTF-8, the encoding which Vim is working with. Otherwise only ASCII can
  46. be displayed and edited correctly.
  47. For the GUI you must select fonts that work with UTF-8. This
  48. is the difficult part. It depends on the system you are using, the locale and
  49. a few other things.
  50. For X11 you can set the 'guifontset' option to a list of fonts that together
  51. cover the characters that are used. Example for Korean: >
  52. :set guifontset=k12,r12
  53. Alternatively, you can set 'guifont' and 'guifontwide'. 'guifont' is used for
  54. the single-width characters, 'guifontwide' for the double-width characters.
  55. Thus the 'guifontwide' font must be exactly twice as wide as 'guifont'.
  56. Example for UTF-8: >
  57. :set guifont=-misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1
  58. :set guifontwide=-misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1
  59. You can also set 'guifont' alone, Vim will try to find a matching
  60. 'guifontwide' for you.
  61. INPUT
  62. There are several ways to enter multi-byte characters:
  63. - For X11 XIM can be used. See |XIM|.
  64. - For MS-Windows IME can be used. See |IME|.
  65. - For all systems keymaps can be used. See |mbyte-keymap|.
  66. The options 'iminsert', 'imsearch' and 'imcmdline' can be used to chose
  67. the different input methods or disable them temporarily.
  68. ==============================================================================
  69. Locale *mbyte-locale*
  70. The easiest setup is when your whole system uses the locale you want to work
  71. in. But it's also possible to set the locale for one shell you are working
  72. in, or just use a certain locale inside Vim.
  73. WHAT IS A LOCALE? *locale*
  74. There are many of languages in the world. And there are different cultures
  75. and environments at least as much as the number of languages. A linguistic
  76. environment corresponding to an area is called "locale". This includes
  77. information about the used language, the charset, collating order for sorting,
  78. date format, currency format and so on. For Vim only the language and charset
  79. really matter.
  80. You can only use a locale if your system has support for it. Some systems
  81. have only a few locales, especially in the USA. The language which you want
  82. to use may not be on your system. In that case you might be able to install
  83. it as an extra package. Check your system documentation for how to do that.
  84. The location in which the locales are installed varies from system to system.
  85. For example, "/usr/share/locale" or "/usr/lib/locale". See your system's
  86. setlocale() man page.
  87. Looking in these directories will show you the exact name of each locale.
  88. Mostly upper/lowercase matters, thus "ja_JP.EUC" and "ja_jp.euc" are
  89. different. Some systems have a locale.alias file, which allows translation
  90. from a short name like "nl" to the full name "nl_NL.ISO_8859-1".
  91. Note that X-windows has its own locale stuff. And unfortunately uses locale
  92. names different from what is used elsewhere. This is confusing! For Vim it
  93. matters what the setlocale() function uses, which is generally NOT the
  94. X-windows stuff. You might have to do some experiments to find out what
  95. really works.
  96. *locale-name*
  97. The (simplified) format of |locale| name is:
  98. language
  99. or language_territory
  100. or language_territory.codeset
  101. Territory means the country (or part of it), codeset means the |charset|. For
  102. example, the locale name "ja_JP.eucJP" means:
  103. ja the language is Japanese
  104. JP the country is Japan
  105. eucJP the codeset is EUC-JP
  106. But it also could be "ja", "ja_JP.EUC", "ja_JP.ujis", etc. And unfortunately,
  107. the locale name for a specific language, territory and codeset is not unified
  108. and depends on your system.
  109. Examples of locale name:
  110. charset language locale name ~
  111. GB2312 Chinese (simplified) zh_CN.EUC, zh_CN.GB2312
  112. Big5 Chinese (traditional) zh_TW.BIG5, zh_TW.Big5
  113. CNS-11643 Chinese (traditional) zh_TW
  114. EUC-JP Japanese ja, ja_JP.EUC, ja_JP.ujis, ja_JP.eucJP
  115. Shift_JIS Japanese ja_JP.SJIS, ja_JP.Shift_JIS
  116. EUC-KR Korean ko, ko_KR.EUC
  117. USING A LOCALE
  118. To start using a locale for the whole system, see the documentation of your
  119. system. Mostly you need to set it in a configuration file in "/etc".
  120. To use a locale in a shell, set the $LANG environment value. When you want to
  121. use Korean and the |locale| name is "ko", do this:
  122. sh: export LANG=ko
  123. csh: setenv LANG ko
  124. You can put this in your ~/.profile or ~/.cshrc file to always use it.
  125. To use a locale in Vim only, use the |:language| command: >
  126. :language ko
  127. Put this in your |init.vim| file to use it always.
  128. Or specify $LANG when starting Vim:
  129. sh: LANG=ko vim {vim-arguments}
  130. csh: env LANG=ko vim {vim-arguments}
  131. You could make a small shell script for this.
  132. ==============================================================================
  133. Encoding *mbyte-encoding*
  134. In Nvim UTF-8 is always used internally to encode characters.
  135. This applies to all the places where text is used, including buffers (files
  136. loaded into memory), registers and variables.
  137. *charset* *codeset*
  138. Charset is another name for encoding. There are subtle differences, but these
  139. don't matter when using Vim. "codeset" is another similar name.
  140. Each character is encoded as one or more bytes. When all characters are
  141. encoded with one byte, we call this a single-byte encoding. The most often
  142. used one is called "latin1". This limits the number of characters to 256.
  143. Some of these are control characters, thus even fewer can be used for text.
  144. When some characters use two or more bytes, we call this a multi-byte
  145. encoding. This allows using much more than 256 characters, which is required
  146. for most East Asian languages.
  147. Most multi-byte encodings use one byte for the first 127 characters. These
  148. are equal to ASCII, which makes it easy to exchange plain-ASCII text, no
  149. matter what language is used. Thus you might see the right text even when the
  150. encoding was set wrong.
  151. *encoding-names*
  152. Vim can edit files in different character encodings. There are three major groups:
  153. 1 8bit Single-byte encodings, 256 different characters. Mostly used
  154. in USA and Europe. Example: ISO-8859-1 (Latin1). All
  155. characters occupy one screen cell only.
  156. 2 2byte Double-byte encodings, over 10000 different characters.
  157. Mostly used in Asian countries. Example: euc-kr (Korean)
  158. The number of screen cells is equal to the number of bytes
  159. (except for euc-jp when the first byte is 0x8e).
  160. u Unicode Universal encoding, can replace all others. ISO 10646.
  161. Millions of different characters. Example: UTF-8. The
  162. relation between bytes and screen cells is complex.
  163. Only UTF-8 is used by Vim internally. But files in other
  164. encodings can be edited by using conversion, see 'fileencoding'.
  165. Recognized 'fileencoding' values include: *encoding-values*
  166. 1 latin1 8-bit characters (ISO 8859-1, also used for cp1252)
  167. 1 iso-8859-n ISO_8859 variant (n = 2 to 15)
  168. 1 koi8-r Russian
  169. 1 koi8-u Ukrainian
  170. 1 macroman MacRoman (Macintosh encoding)
  171. 1 8bit-{name} any 8-bit encoding (Vim specific name)
  172. 1 cp437 similar to iso-8859-1
  173. 1 cp737 similar to iso-8859-7
  174. 1 cp775 Baltic
  175. 1 cp850 similar to iso-8859-4
  176. 1 cp852 similar to iso-8859-1
  177. 1 cp855 similar to iso-8859-2
  178. 1 cp857 similar to iso-8859-5
  179. 1 cp860 similar to iso-8859-9
  180. 1 cp861 similar to iso-8859-1
  181. 1 cp862 similar to iso-8859-1
  182. 1 cp863 similar to iso-8859-8
  183. 1 cp865 similar to iso-8859-1
  184. 1 cp866 similar to iso-8859-5
  185. 1 cp869 similar to iso-8859-7
  186. 1 cp874 Thai
  187. 1 cp1250 Czech, Polish, etc.
  188. 1 cp1251 Cyrillic
  189. 1 cp1253 Greek
  190. 1 cp1254 Turkish
  191. 1 cp1255 Hebrew
  192. 1 cp1256 Arabic
  193. 1 cp1257 Baltic
  194. 1 cp1258 Vietnamese
  195. 1 cp{number} MS-Windows: any installed single-byte codepage
  196. 2 cp932 Japanese (Windows only)
  197. 2 euc-jp Japanese (Unix only)
  198. 2 sjis Japanese (Unix only)
  199. 2 cp949 Korean (Unix and Windows)
  200. 2 euc-kr Korean (Unix only)
  201. 2 cp936 simplified Chinese (Windows only)
  202. 2 euc-cn simplified Chinese (Unix only)
  203. 2 cp950 traditional Chinese (on Unix alias for big5)
  204. 2 big5 traditional Chinese (on Windows alias for cp950)
  205. 2 euc-tw traditional Chinese (Unix only)
  206. 2 2byte-{name} Unix: any double-byte encoding (Vim specific name)
  207. 2 cp{number} MS-Windows: any installed double-byte codepage
  208. u utf-8 32 bit UTF-8 encoded Unicode (ISO/IEC 10646-1)
  209. u ucs-2 16 bit UCS-2 encoded Unicode (ISO/IEC 10646-1)
  210. u ucs-2le like ucs-2, little endian
  211. u utf-16 ucs-2 extended with double-words for more characters
  212. u utf-16le like utf-16, little endian
  213. u ucs-4 32 bit UCS-4 encoded Unicode (ISO/IEC 10646-1)
  214. u ucs-4le like ucs-4, little endian
  215. The {name} can be any encoding name that your system supports. It is passed
  216. to iconv() to convert between UTF-8 and the encoding of the file.
  217. For MS-Windows "cp{number}" means using codepage {number}.
  218. Examples: >
  219. :set fileencoding=8bit-cp1252
  220. :set fileencoding=2byte-cp932
  221. The MS-Windows codepage 1252 is very similar to latin1. For practical reasons
  222. the same encoding is used and it's called latin1. 'isprint' can be used to
  223. display the characters 0x80 - 0xA0 or not.
  224. Several aliases can be used, they are translated to one of the names above.
  225. An incomplete list:
  226. 1 ansi same as latin1 (obsolete, for backward compatibility)
  227. 2 japan Japanese: on Unix "euc-jp", on MS-Windows cp932
  228. 2 korea Korean: on Unix "euc-kr", on MS-Windows cp949
  229. 2 prc simplified Chinese: on Unix "euc-cn", on MS-Windows cp936
  230. 2 chinese same as "prc"
  231. 2 taiwan traditional Chinese: on Unix "euc-tw", on MS-Windows cp950
  232. u utf8 same as utf-8
  233. u unicode same as ucs-2
  234. u ucs2be same as ucs-2 (big endian)
  235. u ucs-2be same as ucs-2 (big endian)
  236. u ucs-4be same as ucs-4 (big endian)
  237. u utf-32 same as ucs-4
  238. u utf-32le same as ucs-4le
  239. default the encoding of the current locale.
  240. For the UCS codes the byte order matters. This is tricky, use UTF-8 whenever
  241. you can. The default is to use big-endian (most significant byte comes
  242. first):
  243. name bytes char ~
  244. ucs-2 11 22 1122
  245. ucs-2le 22 11 1122
  246. ucs-4 11 22 33 44 11223344
  247. ucs-4le 44 33 22 11 11223344
  248. On MS-Windows systems you often want to use "ucs-2le", because it uses little
  249. endian UCS-2.
  250. There are a few encodings which are similar, but not exactly the same. Vim
  251. treats them as if they were different encodings, so that conversion will be
  252. done when needed. You might want to use the similar name to avoid conversion
  253. or when conversion is not possible:
  254. cp932, shift-jis, sjis
  255. cp936, euc-cn
  256. CONVERSION *charset-conversion*
  257. Vim will automatically convert from one to another encoding in several places:
  258. - When reading a file and 'fileencoding' is different from "utf-8"
  259. - When writing a file and 'fileencoding' is different from "utf-8"
  260. - When displaying messages and the encoding used for LC_MESSAGES differs from
  261. "utf-8" (requires a gettext version that supports this).
  262. - When reading a Vim script where |:scriptencoding| is different from
  263. "utf-8".
  264. Most of these require the |+iconv| feature. Conversion for reading and
  265. writing files may also be specified with the 'charconvert' option.
  266. Useful utilities for converting the charset:
  267. All: iconv
  268. GNU iconv can convert most encodings. Unicode is used as the
  269. intermediate encoding, which allows conversion from and to all other
  270. encodings. See http://www.gnu.org/directory/libiconv.html.
  271. Japanese: nkf
  272. Nkf is "Network Kanji code conversion Filter". One of the most unique
  273. facility of nkf is the guess of the input Kanji code. So, you don't
  274. need to know what the inputting file's |charset| is. When convert to
  275. EUC-JP from ISO-2022-JP or Shift_JIS, simply do the following command
  276. in Vim:
  277. :%!nkf -e
  278. Nkf can be found at:
  279. http://www.sfc.wide.ad.jp/~max/FreeBSD/ports/distfiles/nkf-1.62.tar.gz
  280. Chinese: hc
  281. Hc is "Hanzi Converter". Hc convert a GB file to a Big5 file, or Big5
  282. file to GB file. Hc can be found at:
  283. ftp://ftp.cuhk.hk/pub/chinese/ifcss/software/unix/convert/hc-30.tar.gz
  284. Korean: hmconv
  285. Hmconv is Korean code conversion utility especially for E-mail. It can
  286. convert between EUC-KR and ISO-2022-KR. Hmconv can be found at:
  287. ftp://ftp.kaist.ac.kr/pub/hangul/code/hmconv/
  288. Multilingual: lv
  289. Lv is a Powerful Multilingual File Viewer. And it can be worked as
  290. |charset| converter. Supported |charset|: ISO-2022-CN, ISO-2022-JP,
  291. ISO-2022-KR, EUC-CN, EUC-JP, EUC-KR, EUC-TW, UTF-7, UTF-8, ISO-8859
  292. series, Shift_JIS, Big5 and HZ. Lv can be found at:
  293. http://www.ff.iij4u.or.jp/~nrt/lv/index.html
  294. *mbyte-conversion*
  295. When reading and writing files in an encoding different from "utf-8",
  296. conversion needs to be done. These conversions are supported:
  297. - All conversions between Latin-1 (ISO-8859-1), UTF-8, UCS-2 and UCS-4 are
  298. handled internally.
  299. - For MS-Windows, conversion from and
  300. to any codepage should work.
  301. - Conversion specified with 'charconvert'
  302. - Conversion with the iconv library, if it is available.
  303. Old versions of GNU iconv() may cause the conversion to fail (they
  304. request a very large buffer, more than Vim is willing to provide).
  305. Try getting another iconv() implementation.
  306. *iconv-dynamic*
  307. On MS-Windows Vim can be compiled with the |+iconv/dyn| feature. This means
  308. Vim will search for the "iconv.dll" and "libiconv.dll" libraries. When
  309. neither of them can be found Vim will still work but some conversions won't be
  310. possible.
  311. ==============================================================================
  312. Fonts on X11 *mbyte-fonts-X11*
  313. Unfortunately, using fonts in X11 is complicated. The name of a single-byte
  314. font is a long string. For multi-byte fonts we need several of these...
  315. First of all, Vim only accepts fixed-width fonts for displaying text. You
  316. cannot use proportionally spaced fonts. This excludes many of the available
  317. (and nicer looking) fonts. However, for menus and tooltips any font can be
  318. used.
  319. Note that Display and Input are independent. It is possible to see your
  320. language even though you have no input method for it.
  321. You should get a default font for menus and tooltips that works, but it might
  322. be ugly. Read the following to find out how to select a better font.
  323. X LOGICAL FONT DESCRIPTION (XLFD)
  324. *XLFD*
  325. XLFD is the X font name and contains the information about the font size,
  326. charset, etc. The name is in this format:
  327. FOUNDRY-FAMILY-WEIGHT-SLANT-WIDTH-STYLE-PIXEL-POINT-X-Y-SPACE-AVE-CR-CE
  328. Each field means:
  329. - FOUNDRY: FOUNDRY field. The company that created the font.
  330. - FAMILY: FAMILY_NAME field. Basic font family name. (helvetica, gothic,
  331. times, etc)
  332. - WEIGHT: WEIGHT_NAME field. How thick the letters are. (light, medium,
  333. bold, etc)
  334. - SLANT: SLANT field.
  335. r: Roman (no slant)
  336. i: Italic
  337. o: Oblique
  338. ri: Reverse Italic
  339. ro: Reverse Oblique
  340. ot: Other
  341. number: Scaled font
  342. - WIDTH: SETWIDTH_NAME field. Width of characters. (normal, condensed,
  343. narrow, double wide)
  344. - STYLE: ADD_STYLE_NAME field. Extra info to describe font. (Serif, Sans
  345. Serif, Informal, Decorated, etc)
  346. - PIXEL: PIXEL_SIZE field. Height, in pixels, of characters.
  347. - POINT: POINT_SIZE field. Ten times height of characters in points.
  348. - X: RESOLUTION_X field. X resolution (dots per inch).
  349. - Y: RESOLUTION_Y field. Y resolution (dots per inch).
  350. - SPACE: SPACING field.
  351. p: Proportional
  352. m: Monospaced
  353. c: CharCell
  354. - AVE: AVERAGE_WIDTH field. Ten times average width in pixels.
  355. - CR: CHARSET_REGISTRY field. The name of the charset group.
  356. - CE: CHARSET_ENCODING field. The rest of the charset name. For some
  357. charsets, such as JIS X 0208, if this field is 0, code points has
  358. the same value as GL, and GR if 1.
  359. For example, in case of a 16 dots font corresponding to JIS X 0208, it is
  360. written like:
  361. -misc-fixed-medium-r-normal--16-110-100-100-c-160-jisx0208.1990-0
  362. X FONTSET
  363. *fontset* *xfontset*
  364. A single-byte charset is typically associated with one font. For multi-byte
  365. charsets a combination of fonts is often used. This means that one group of
  366. characters are used from one font and another group from another font (which
  367. might be double wide). This collection of fonts is called a fontset.
  368. Which fonts are required in a fontset depends on the current locale. X
  369. windows maintains a table of which groups of characters are required for a
  370. locale. You have to specify all the fonts that a locale requires in the
  371. 'guifontset' option.
  372. NOTE: The fontset always uses the current locale, even though 'encoding' may
  373. be set to use a different charset. In that situation you might want to use
  374. 'guifont' and 'guifontwide' instead of 'guifontset'.
  375. Example:
  376. |charset| language "groups of characters" ~
  377. GB2312 Chinese (simplified) ISO-8859-1 and GB 2312
  378. Big5 Chinese (traditional) ISO-8859-1 and Big5
  379. CNS-11643 Chinese (traditional) ISO-8859-1, CNS 11643-1 and CNS 11643-2
  380. EUC-JP Japanese JIS X 0201 and JIS X 0208
  381. EUC-KR Korean ISO-8859-1 and KS C 5601 (KS X 1001)
  382. You can search for fonts using the xlsfonts command. For example, when you're
  383. searching for a font for KS C 5601: >
  384. xlsfonts | grep ksc5601
  385. This is complicated and confusing. You might want to consult the X-Windows
  386. documentation if there is something you don't understand.
  387. *base_font_name_list*
  388. When you have found the names of the fonts you want to use, you need to set
  389. the 'guifontset' option. You specify the list by concatenating the font names
  390. and putting a comma in between them.
  391. For example, when you use the ja_JP.eucJP locale, this requires JIS X 0201
  392. and JIS X 0208. You could supply a list of fonts that explicitly specifies
  393. the charsets, like: >
  394. :set guifontset=-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-0,
  395. \-misc-fixed-medium-r-normal--14-130-75-75-c-70-jisx0201.1976-0
  396. Alternatively, you can supply a base font name list that omits the charset
  397. name, letting X-Windows select font characters required for the locale. For
  398. example: >
  399. :set guifontset=-misc-fixed-medium-r-normal--14-130-75-75-c-140,
  400. \-misc-fixed-medium-r-normal--14-130-75-75-c-70
  401. Alternatively, you can supply a single base font name that allows X-Windows to
  402. select from all available fonts. For example: >
  403. :set guifontset=-misc-fixed-medium-r-normal--14-*
  404. Alternatively, you can specify alias names. See the fonts.alias file in the
  405. fonts directory (e.g., /usr/X11R6/lib/X11/fonts/). For example: >
  406. :set guifontset=k14,r14
  407. <
  408. *E253*
  409. Note that in East Asian fonts, the standard character cell is square. When
  410. mixing a Latin font and an East Asian font, the East Asian font width should
  411. be twice the Latin font width.
  412. If 'guifontset' is not empty, the "font" argument of the |:highlight| command
  413. is also interpreted as a fontset. For example, you should use for
  414. highlighting: >
  415. :hi Comment font=english_font,your_font
  416. If you use a wrong "font" argument you will get an error message.
  417. Also make sure that you set 'guifontset' before setting fonts for highlight
  418. groups.
  419. ==============================================================================
  420. Input on X11 *mbyte-XIM*
  421. X INPUT METHOD (XIM) BACKGROUND *XIM* *xim* *x-input-method*
  422. XIM is an international input module for X. There are two kinds of structures,
  423. Xlib unit type and |IM-server| (Input-Method server) type. |IM-server| type
  424. is suitable for complex input, such as CJK.
  425. - IM-server
  426. *IM-server*
  427. In |IM-server| type input structures, the input event is handled by either
  428. of the two ways: FrontEnd system and BackEnd system. In the FrontEnd
  429. system, input events are snatched by the |IM-server| first, then |IM-server|
  430. give the application the result of input. On the other hand, the BackEnd
  431. system works reverse order. MS Windows adopt BackEnd system. In X, most of
  432. |IM-server|s adopt FrontEnd system. The demerit of BackEnd system is the
  433. large overhead in communication, but it provides safe synchronization with
  434. no restrictions on applications.
  435. For example, there are xwnmo and kinput2 Japanese |IM-server|, both are
  436. FrontEnd system. Xwnmo is distributed with Wnn (see below), kinput2 can be
  437. found at: ftp://ftp.sra.co.jp/pub/x11/kinput2/
  438. For Chinese, there's a great XIM server named "xcin", you can input both
  439. Traditional and Simplified Chinese characters. And it can accept other
  440. locale if you make a correct input table. Xcin can be found at:
  441. http://cle.linux.org.tw/xcin/
  442. Others are scim: http://scim.freedesktop.org/ and fcitx:
  443. http://www.fcitx.org/
  444. - Conversion Server
  445. *conversion-server*
  446. Some system needs additional server: conversion server. Most of Japanese
  447. |IM-server|s need it, Kana-Kanji conversion server. For Chinese inputting,
  448. it depends on the method of inputting, in some methods, PinYin or ZhuYin to
  449. HanZi conversion server is needed. For Korean inputting, if you want to
  450. input Hanja, Hangul-Hanja conversion server is needed.
  451. For example, the Japanese inputting process is divided into 2 steps. First
  452. we pre-input Hira-gana, second Kana-Kanji conversion. There are so many
  453. Kanji characters (6349 Kanji characters are defined in JIS X 0208) and the
  454. number of Hira-gana characters are 76. So, first, we pre-input text as
  455. pronounced in Hira-gana, second, we convert Hira-gana to Kanji or Kata-Kana,
  456. if needed. There are some Kana-Kanji conversion server: jserver
  457. (distributed with Wnn, see below) and canna. Canna can be found at:
  458. http://canna.sourceforge.jp/
  459. There is a good input system: Wnn4.2. Wnn 4.2 contains,
  460. xwnmo (|IM-server|)
  461. jserver (Japanese Kana-Kanji conversion server)
  462. cserver (Chinese PinYin or ZhuYin to simplified HanZi conversion server)
  463. tserver (Chinese PinYin or ZhuYin to traditional HanZi conversion server)
  464. kserver (Hangul-Hanja conversion server)
  465. Wnn 4.2 for several systems can be found at various places on the internet.
  466. Use the RPM or port for your system.
  467. - Input Style
  468. *xim-input-style*
  469. When inputting CJK, there are four areas:
  470. 1. The area to display of the input while it is being composed
  471. 2. The area to display the currently active input mode.
  472. 3. The area to display the next candidate for the selection.
  473. 4. The area to display other tools.
  474. The third area is needed when converting. For example, in Japanese
  475. inputting, multiple Kanji characters could have the same pronunciation, so
  476. a sequence of Hira-gana characters could map to a distinct sequence of Kanji
  477. characters.
  478. The first and second areas are defined in international input of X with the
  479. names of "Preedit Area", "Status Area" respectively. The third and fourth
  480. areas are not defined and are left to be managed by the |IM-server|. In the
  481. international input, four input styles have been defined using combinations
  482. of Preedit Area and Status Area: |OnTheSpot|, |OffTheSpot|, |OverTheSpot|
  483. and |Root|.
  484. Currently, GUI Vim supports three styles, |OverTheSpot|, |OffTheSpot| and
  485. |Root|.
  486. *. on-the-spot *OnTheSpot*
  487. Preedit Area and Status Area are performed by the client application in
  488. the area of application. The client application is directed by the
  489. |IM-server| to display all pre-edit data at the location of text
  490. insertion. The client registers callbacks invoked by the input method
  491. during pre-editing.
  492. *. over-the-spot *OverTheSpot*
  493. Status Area is created in a fixed position within the area of application,
  494. in case of Vim, the position is the additional status line. Preedit Area
  495. is made at present input position of application. The input method
  496. displays pre-edit data in a window which it brings up directly over the
  497. text insertion position.
  498. *. off-the-spot *OffTheSpot*
  499. Preedit Area and Status Area are performed in the area of application, in
  500. case of Vim, the area is additional status line. The client application
  501. provides display windows for the pre-edit data to the input method which
  502. displays into them directly.
  503. *. root-window *Root*
  504. Preedit Area and Status Area are outside of the application. The input
  505. method displays all pre-edit data in a separate area of the screen in a
  506. window specific to the input method.
  507. USING XIM *multibyte-input* *E284* *E286* *E287* *E288*
  508. *E285* *E289*
  509. Note that Display and Input are independent. It is possible to see your
  510. language even though you have no input method for it. But when your Display
  511. method doesn't match your Input method, the text will be displayed wrong.
  512. Note: You can not use IM unless you specify 'guifontset'.
  513. Therefore, Latin users, you have to also use 'guifontset'
  514. if you use IM.
  515. To input your language you should run the |IM-server| which supports your
  516. language and |conversion-server| if needed.
  517. The next 3 lines should be put in your ~/.Xdefaults file. They are common for
  518. all X applications which uses |XIM|. If you already use |XIM|, you can skip
  519. this. >
  520. *international: True
  521. *.inputMethod: your_input_server_name
  522. *.preeditType: your_input_style
  523. <
  524. input_server_name is your |IM-server| name (check your |IM-server|
  525. manual).
  526. your_input_style is one of |OverTheSpot|, |OffTheSpot|, |Root|. See
  527. also |xim-input-style|.
  528. *international may not necessary if you use X11R6.
  529. *.inputMethod and *.preeditType are optional if you use X11R6.
  530. For example, when you are using kinput2 as |IM-server|, >
  531. *international: True
  532. *.inputMethod: kinput2
  533. *.preeditType: OverTheSpot
  534. <
  535. When using |OverTheSpot|, GUI Vim always connects to the IM Server even in
  536. Normal mode, so you can input your language with commands like "f" and "r".
  537. But when using one of the other two methods, GUI Vim connects to the IM Server
  538. only if it is not in Normal mode.
  539. If your IM Server does not support |OverTheSpot|, and if you want to use your
  540. language with some Normal mode command like "f" or "r", then you should use a
  541. localized xterm or an xterm which supports |XIM|
  542. If needed, you can set the XMODIFIERS environment variable:
  543. sh: export XMODIFIERS="@im=input_server_name"
  544. csh: setenv XMODIFIERS "@im=input_server_name"
  545. For example, when you are using kinput2 as |IM-server| and sh, >
  546. export XMODIFIERS="@im=kinput2"
  547. <
  548. ==============================================================================
  549. Input with a keymap *mbyte-keymap*
  550. When the keyboard doesn't produce the characters you want to enter in your
  551. text, you can use the 'keymap' option. This will translate one or more
  552. (English) characters to another (non-English) character. This only happens
  553. when typing text, not when typing Vim commands. This avoids having to switch
  554. between two keyboard settings.
  555. The value of the 'keymap' option specifies a keymap file to use. The name of
  556. this file is one of these two:
  557. keymap/{keymap}_utf-8.vim
  558. keymap/{keymap}.vim
  559. Here {keymap} is the value of the 'keymap' option.
  560. The file name with "utf-8" included is tried first.
  561. 'runtimepath' is used to find these files. To see an overview of all
  562. available keymap files, use this: >
  563. :echo globpath(&rtp, "keymap/*.vim")
  564. In Insert and Command-line mode you can use CTRL-^ to toggle between using the
  565. keyboard map or not. |i_CTRL-^| |c_CTRL-^|
  566. This flag is remembered for Insert mode with the 'iminsert' option. When
  567. leaving and entering Insert mode the previous value is used. The same value
  568. is also used for commands that take a single character argument, like |f| and
  569. |r|.
  570. For Command-line mode the flag is NOT remembered. You are expected to type an
  571. Ex command first, which is ASCII.
  572. For typing search patterns the 'imsearch' option is used. It can be set to
  573. use the same value as for 'iminsert'.
  574. *lCursor*
  575. It is possible to give the GUI cursor another color when the language mappings
  576. are being used. This is disabled by default, to avoid that the cursor becomes
  577. invisible when you use a non-standard background color. Here is an example to
  578. use a brightly colored cursor: >
  579. :highlight Cursor guifg=NONE guibg=Green
  580. :highlight lCursor guifg=NONE guibg=Cyan
  581. <
  582. *keymap-file-format* *:loadk* *:loadkeymap* *E105* *E791*
  583. The keymap file looks something like this: >
  584. " Maintainer: name <email@address>
  585. " Last Changed: 2001 Jan 1
  586. let b:keymap_name = "short"
  587. loadkeymap
  588. a A
  589. b B comment
  590. The lines starting with a " are comments and will be ignored. Blank lines are
  591. also ignored. The lines with the mappings may have a comment after the useful
  592. text.
  593. The "b:keymap_name" can be set to a short name, which will be shown in the
  594. status line. The idea is that this takes less room than the value of
  595. 'keymap', which might be long to distinguish between different languages,
  596. keyboards and encodings.
  597. The actual mappings are in the lines below "loadkeymap". In the example "a"
  598. is mapped to "A" and "b" to "B". Thus the first item is mapped to the second
  599. item. This is done for each line, until the end of the file.
  600. These items are exactly the same as what can be used in a |:lmap| command,
  601. using "<buffer>" to make the mappings local to the buffer.
  602. You can check the result with this command: >
  603. :lmap
  604. The two items must be separated by white space. You cannot include white
  605. space inside an item, use the special names "<Tab>" and "<Space>" instead.
  606. The length of the two items together must not exceed 200 bytes.
  607. It's possible to have more than one character in the first column. This works
  608. like a dead key. Example: >
  609. 'a á
  610. Since Vim doesn't know if the next character after a quote is really an "a",
  611. it will wait for the next character. To be able to insert a single quote,
  612. also add this line: >
  613. '' '
  614. Since the mapping is defined with |:lmap| the resulting quote will not be
  615. used for the start of another character defined in the 'keymap'.
  616. It can be used in a standard |:imap| mapping.
  617. The "accents" keymap uses this. *keymap-accents*
  618. The first column can also be in |<>| form:
  619. <C-c> Ctrl-C
  620. <A-c> Alt-c
  621. <A-C> Alt-C
  622. Note that the Alt mappings may not work, depending on your keyboard and
  623. terminal.
  624. Although it's possible to have more than one character in the second column,
  625. this is unusual. But you can use various ways to specify the character: >
  626. A a literal character
  627. A <char-97> decimal value
  628. A <char-0x61> hexadecimal value
  629. A <char-0141> octal value
  630. x <Space> special key name
  631. The characters are assumed to be encoded in UTF-8.
  632. It's possible to use ":scriptencoding" when all characters are given
  633. literally. That doesn't work when using the <char-> construct, because the
  634. conversion is done on the keymap file, not on the resulting character.
  635. The lines after "loadkeymap" are interpreted with 'cpoptions' set to "C".
  636. This means that continuation lines are not used and a backslash has a special
  637. meaning in the mappings. Examples: >
  638. " a comment line
  639. \" x maps " to x
  640. \\ y maps \ to y
  641. If you write a keymap file that will be useful for others, consider submitting
  642. it to the Vim maintainer for inclusion in the distribution:
  643. <maintainer@vim.org>
  644. HEBREW KEYMAP *keymap-hebrew*
  645. This file explains what characters are available in UTF-8 and CP1255 encodings,
  646. and what the keymaps are to get those characters:
  647. glyph encoding keymap ~
  648. Char utf-8 cp1255 hebrew hebrewp name ~
  649. א 0x5d0 0xe0 t a 'alef
  650. ב 0x5d1 0xe1 c b bet
  651. ג 0x5d2 0xe2 d g gimel
  652. ד 0x5d3 0xe3 s d dalet
  653. ה 0x5d4 0xe4 v h he
  654. ו 0x5d5 0xe5 u v vav
  655. ז 0x5d6 0xe6 z z zayin
  656. ח 0x5d7 0xe7 j j het
  657. ט 0x5d8 0xe8 y T tet
  658. י 0x5d9 0xe9 h y yod
  659. ך 0x5da 0xea l K kaf sofit
  660. כ 0x5db 0xeb f k kaf
  661. ל 0x5dc 0xec k l lamed
  662. ם 0x5dd 0xed o M mem sofit
  663. מ 0x5de 0xee n m mem
  664. ן 0x5df 0xef i N nun sofit
  665. נ 0x5e0 0xf0 b n nun
  666. ס 0x5e1 0xf1 x s samech
  667. ע 0x5e2 0xf2 g u `ayin
  668. ף 0x5e3 0xf3 ; P pe sofit
  669. פ 0x5e4 0xf4 p p pe
  670. ץ 0x5e5 0xf5 . X tsadi sofit
  671. צ 0x5e6 0xf6 m x tsadi
  672. ק 0x5e7 0xf7 e q qof
  673. ר 0x5e8 0xf8 r r resh
  674. ש 0x5e9 0xf9 a w shin
  675. ת 0x5ea 0xfa , t tav
  676. Vowel marks and special punctuation:
  677. הְ 0x5b0 0xc0 A: A: sheva
  678. הֱ 0x5b1 0xc1 HE HE hataf segol
  679. הֲ 0x5b2 0xc2 HA HA hataf patah
  680. הֳ 0x5b3 0xc3 HO HO hataf qamats
  681. הִ 0x5b4 0xc4 I I hiriq
  682. הֵ 0x5b5 0xc5 AY AY tsere
  683. הֶ 0x5b6 0xc6 E E segol
  684. הַ 0x5b7 0xc7 AA AA patah
  685. הָ 0x5b8 0xc8 AO AO qamats
  686. הֹ 0x5b9 0xc9 O O holam
  687. הֻ 0x5bb 0xcb U U qubuts
  688. כּ 0x5bc 0xcc D D dagesh
  689. הֽ 0x5bd 0xcd ]T ]T meteg
  690. ה־ 0x5be 0xce ]Q ]Q maqaf
  691. בֿ 0x5bf 0xcf ]R ]R rafe
  692. ב׀ 0x5c0 0xd0 ]p ]p paseq
  693. שׁ 0x5c1 0xd1 SR SR shin-dot
  694. שׂ 0x5c2 0xd2 SL SL sin-dot
  695. ׃ 0x5c3 0xd3 ]P ]P sof-pasuq
  696. װ 0x5f0 0xd4 VV VV double-vav
  697. ױ 0x5f1 0xd5 VY VY vav-yod
  698. ײ 0x5f2 0xd6 YY YY yod-yod
  699. The following are only available in utf-8
  700. Cantillation marks:
  701. glyph
  702. Char utf-8 hebrew name
  703. ב֑ 0x591 C: etnahta
  704. ב֒ 0x592 Cs segol
  705. ב֓ 0x593 CS shalshelet
  706. ב֔ 0x594 Cz zaqef qatan
  707. ב֕ 0x595 CZ zaqef gadol
  708. ב֖ 0x596 Ct tipeha
  709. ב֗ 0x597 Cr revia
  710. ב֘ 0x598 Cq zarqa
  711. ב֙ 0x599 Cp pashta
  712. ב֚ 0x59a C! yetiv
  713. ב֛ 0x59b Cv tevir
  714. ב֜ 0x59c Cg geresh
  715. ב֝ 0x59d C* geresh qadim
  716. ב֞ 0x59e CG gershayim
  717. ב֟ 0x59f CP qarnei-parah
  718. ב֪ 0x5aa Cy yerach-ben-yomo
  719. ב֫ 0x5ab Co ole
  720. ב֬ 0x5ac Ci iluy
  721. ב֭ 0x5ad Cd dehi
  722. ב֮ 0x5ae Cn zinor
  723. ב֯ 0x5af CC masora circle
  724. Combining forms:
  725. ﬠ 0xfb20 X` Alternative `ayin
  726. ﬡ 0xfb21 X' Alternative 'alef
  727. ﬢ 0xfb22 X-d Alternative dalet
  728. ﬣ 0xfb23 X-h Alternative he
  729. ﬤ 0xfb24 X-k Alternative kaf
  730. ﬥ 0xfb25 X-l Alternative lamed
  731. ﬦ 0xfb26 X-m Alternative mem-sofit
  732. ﬧ 0xfb27 X-r Alternative resh
  733. ﬨ 0xfb28 X-t Alternative tav
  734. ﬩ 0xfb29 X-+ Alternative plus
  735. שׁ 0xfb2a XW shin+shin-dot
  736. שׂ 0xfb2b Xw shin+sin-dot
  737. שּׁ 0xfb2c X..W shin+shin-dot+dagesh
  738. שּׂ 0xfb2d X..w shin+sin-dot+dagesh
  739. אַ 0xfb2e XA alef+patah
  740. אָ 0xfb2f XO alef+qamats
  741. אּ 0xfb30 XI alef+hiriq (mapiq)
  742. בּ 0xfb31 X.b bet+dagesh
  743. גּ 0xfb32 X.g gimel+dagesh
  744. דּ 0xfb33 X.d dalet+dagesh
  745. הּ 0xfb34 X.h he+dagesh
  746. וּ 0xfb35 Xu vav+dagesh
  747. זּ 0xfb36 X.z zayin+dagesh
  748. טּ 0xfb38 X.T tet+dagesh
  749. יּ 0xfb39 X.y yud+dagesh
  750. ךּ 0xfb3a X.K kaf sofit+dagesh
  751. כּ 0xfb3b X.k kaf+dagesh
  752. לּ 0xfb3c X.l lamed+dagesh
  753. מּ 0xfb3e X.m mem+dagesh
  754. נּ 0xfb40 X.n nun+dagesh
  755. סּ 0xfb41 X.s samech+dagesh
  756. ףּ 0xfb43 X.P pe sofit+dagesh
  757. פּ 0xfb44 X.p pe+dagesh
  758. צּ 0xfb46 X.x tsadi+dagesh
  759. קּ 0xfb47 X.q qof+dagesh
  760. רּ 0xfb48 X.r resh+dagesh
  761. שּ 0xfb49 X.w shin+dagesh
  762. תּ 0xfb4a X.t tav+dagesh
  763. וֹ 0xfb4b Xo vav+holam
  764. בֿ 0xfb4c XRb bet+rafe
  765. כֿ 0xfb4d XRk kaf+rafe
  766. פֿ 0xfb4e XRp pe+rafe
  767. ﭏ 0xfb4f Xal alef-lamed
  768. ==============================================================================
  769. Using UTF-8 *mbyte-utf8* *UTF-8* *utf-8* *utf8*
  770. *Unicode* *unicode*
  771. The Unicode character set was designed to include all characters from other
  772. character sets. Therefore it is possible to write text in any language using
  773. Unicode (with a few rarely used languages excluded). And it's mostly possible
  774. to mix these languages in one file, which is impossible with other encodings.
  775. Unicode can be encoded in several ways. The most popular one is UTF-8, which
  776. uses one or more bytes for each character and is backwards compatible with
  777. ASCII. On MS-Windows UTF-16 is also used (previously UCS-2), which uses
  778. 16-bit words. Vim can support all of these encodings, but always uses UTF-8
  779. internally.
  780. Vim has comprehensive UTF-8 support. It works well in:
  781. - xterm with utf-8 support enabled
  782. - MS-Windows GUI
  783. - several other platforms
  784. Double-width characters are supported. This works best with 'guifontwide' or
  785. 'guifontset'. When using only 'guifont' the wide characters are drawn in the
  786. normal width and a space to fill the gap.
  787. *bom-bytes*
  788. When reading a file a BOM (Byte Order Mark) can be used to recognize the
  789. Unicode encoding:
  790. EF BB BF utf-8
  791. FE FF utf-16 big endian
  792. FF FE utf-16 little endian
  793. 00 00 FE FF utf-32 big endian
  794. FF FE 00 00 utf-32 little endian
  795. Utf-8 is the recommended encoding. Note that it's difficult to tell utf-16
  796. and utf-32 apart. Utf-16 is often used on MS-Windows, utf-32 is not
  797. widespread as file format.
  798. *mbyte-combining* *mbyte-composing*
  799. A composing or combining character is used to change the meaning of the
  800. character before it. The combining characters are drawn on top of the
  801. preceding character.
  802. Up to six combining characters can be displayed.
  803. When editing text a composing character is mostly considered part of the
  804. preceding character. For example "x" will delete a character and its
  805. following composing characters by default.
  806. If the 'delcombine' option is on, then pressing 'x' will delete the combining
  807. characters, one at a time, then the base character. But when inserting, you
  808. type the first character and the following composing characters separately,
  809. after which they will be joined. The "r" command will not allow you to type a
  810. combining character, because it doesn't know one is coming. Use "R" instead.
  811. Bytes which are not part of a valid UTF-8 byte sequence are handled like a
  812. single character and displayed as <xx>, where "xx" is the hex value of the
  813. byte.
  814. Overlong sequences are not handled specially and displayed like a valid
  815. character. However, search patterns may not match on an overlong sequence.
  816. (an overlong sequence is where more bytes are used than required for the
  817. character.) An exception is NUL (zero) which is displayed as "<00>".
  818. In the file and buffer the full range of Unicode characters can be used (31
  819. bits). However, displaying only works for the characters present in the
  820. selected font.
  821. Useful commands:
  822. - "ga" shows the decimal, hexadecimal and octal value of the character under
  823. the cursor. If there are composing characters these are shown too. (If the
  824. message is truncated, use ":messages").
  825. - "g8" shows the bytes used in a UTF-8 character, also the composing
  826. characters, as hex numbers.
  827. - ":set fileencodings=" forces using UTF-8 for all files. The
  828. default is to automatically detect the encoding of a file.
  829. STARTING VIM
  830. You might want to select the font used for the menus. Unfortunately this
  831. doesn't always work. See the system specific remarks below, and 'langmenu'.
  832. USING UTF-8 IN X-Windows *utf-8-in-xwindows*
  833. You need to specify a font to be used. For double-wide characters another
  834. font is required, which is exactly twice as wide. There are three ways to do
  835. this:
  836. 1. Set 'guifont' and let Vim find a matching 'guifontwide'
  837. 2. Set 'guifont' and 'guifontwide'
  838. 3. Set 'guifontset'
  839. See the documentation for each option for details. Example: >
  840. :set guifont=-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1
  841. You might also want to set the font used for the menus. This only works for
  842. Motif. Use the ":hi Menu font={fontname}" command for this. |:highlight|
  843. TYPING UTF-8 *utf-8-typing*
  844. If you are using X-Windows, you should find an input method that supports
  845. utf-8.
  846. If your system does not provide support for typing utf-8, you can use the
  847. 'keymap' feature. This allows writing a keymap file, which defines a utf-8
  848. character as a sequence of ASCII characters. See |mbyte-keymap|.
  849. If everything else fails, you can type any character as four hex bytes: >
  850. CTRL-V u 1234
  851. "1234" is interpreted as a hex number. You must type four characters, prepend
  852. a zero if necessary.
  853. COMMAND ARGUMENTS *utf-8-char-arg*
  854. Commands like |f|, |F|, |t| and |r| take an argument of one character. For
  855. UTF-8 this argument may include one or two composing characters. These need
  856. to be produced together with the base character, Vim doesn't wait for the next
  857. character to be typed to find out if it is a composing character or not.
  858. Using 'keymap' or |:lmap| is a nice way to type these characters.
  859. The commands that search for a character in a line handle composing characters
  860. as follows. When searching for a character without a composing character,
  861. this will find matches in the text with or without composing characters. When
  862. searching for a character with a composing character, this will only find
  863. matches with that composing character. It was implemented this way, because
  864. not everybody is able to type a composing character.
  865. ==============================================================================
  866. Overview of options *mbyte-options*
  867. These options are relevant for editing multi-byte files. Check the help in
  868. options.txt for detailed information.
  869. 'encoding' Internal text encoding, always "utf-8".
  870. 'fileencoding' Encoding of a file. When it's different from "utf-8"
  871. conversion is done when reading or writing the file.
  872. 'fileencodings' List of possible encodings of a file. When opening a file
  873. these will be tried and the first one that doesn't cause an
  874. error is used for 'fileencoding'.
  875. 'charconvert' Expression used to convert files from one encoding to another.
  876. 'formatoptions' The 'm' flag can be included to have formatting break a line
  877. at a multibyte character of 256 or higher. Thus is useful for
  878. languages where a sequence of characters can be broken
  879. anywhere.
  880. 'guifontset' The list of font names used for a multi-byte encoding. When
  881. this option is not empty, it replaces 'guifont'.
  882. 'keymap' Specify the name of a keyboard mapping.
  883. ==============================================================================
  884. Contributions specifically for the multi-byte features by:
  885. Chi-Deok Hwang <hwang@mizi.co.kr>
  886. SungHyun Nam <goweol@gmail.com>
  887. K.Nagano <nagano@atese.advantest.co.jp>
  888. Taro Muraoka <koron@tka.att.ne.jp>
  889. Yasuhiro Matsumoto <mattn@mail.goo.ne.jp>
  890. vim:tw=78:ts=8:noet:ft=help:norl: