mbyte.txt 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  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 multibyte
  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. You can set 'guifont'
  48. and 'guifontwide'. 'guifont' is used for the single-width characters,
  49. 'guifontwide' for the double-width characters. Thus the 'guifontwide' font
  50. must be exactly twice as wide as 'guifont'. Example for UTF-8: >
  51. :set guifont=-misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1
  52. :set guifontwide=-misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1
  53. You can also set 'guifont' alone, the Nvim GUI will try to find a matching
  54. 'guifontwide' for you.
  55. INPUT
  56. There are several ways to enter multibyte characters:
  57. - Your system IME can be used.
  58. - Keymaps can be used. See |mbyte-keymap|.
  59. The options 'iminsert', 'imsearch' and 'imcmdline' can be used to choose
  60. the different input methods or disable them temporarily.
  61. ==============================================================================
  62. Locale *mbyte-locale*
  63. The easiest setup is when your whole system uses the locale you want to work
  64. in. But it's also possible to set the locale for one shell you are working
  65. in, or just use a certain locale inside Vim.
  66. WHAT IS A LOCALE? *locale*
  67. There are many languages in the world. And there are different cultures and
  68. environments at least as many as the number of languages. A linguistic
  69. environment corresponding to an area is called "locale". This includes
  70. information about the used language, the charset, collating order for sorting,
  71. date format, currency format and so on. For Vim only the language and charset
  72. really matter.
  73. You can only use a locale if your system has support for it. Some systems
  74. have only a few locales, especially in the USA. The language which you want
  75. to use may not be on your system. In that case you might be able to install
  76. it as an extra package. Check your system documentation for how to do that.
  77. The location in which the locales are installed varies from system to system.
  78. For example, "/usr/share/locale" or "/usr/lib/locale". See your system's
  79. setlocale() man page.
  80. Looking in these directories will show you the exact name of each locale.
  81. Mostly upper/lowercase matters, thus "ja_JP.EUC" and "ja_jp.euc" are
  82. different. Some systems have a locale.alias file, which allows translation
  83. from a short name like "nl" to the full name "nl_NL.ISO_8859-1".
  84. Note that X-windows has its own locale stuff. And unfortunately uses locale
  85. names different from what is used elsewhere. This is confusing! For Vim it
  86. matters what the setlocale() function uses, which is generally NOT the
  87. X-windows stuff. You might have to do some experiments to find out what
  88. really works.
  89. *locale-name*
  90. The (simplified) format of |locale| name is:
  91. language
  92. or language_territory
  93. or language_territory.codeset
  94. Territory means the country (or part of it), codeset means the |charset|. For
  95. example, the locale name "ja_JP.eucJP" means:
  96. ja the language is Japanese
  97. JP the country is Japan
  98. eucJP the codeset is EUC-JP
  99. But it also could be "ja", "ja_JP.EUC", "ja_JP.ujis", etc. And unfortunately,
  100. the locale name for a specific language, territory and codeset is not unified
  101. and depends on your system.
  102. Examples of locale name:
  103. charset language locale name ~
  104. GB2312 Chinese (simplified) zh_CN.EUC, zh_CN.GB2312
  105. Big5 Chinese (traditional) zh_TW.BIG5, zh_TW.Big5
  106. CNS-11643 Chinese (traditional) zh_TW
  107. EUC-JP Japanese ja, ja_JP.EUC, ja_JP.ujis, ja_JP.eucJP
  108. Shift_JIS Japanese ja_JP.SJIS, ja_JP.Shift_JIS
  109. EUC-KR Korean ko, ko_KR.EUC
  110. USING A LOCALE
  111. To start using a locale for the whole system, see the documentation of your
  112. system. Mostly you need to set it in a configuration file in "/etc".
  113. To use a locale in a shell, set the $LANG environment value. When you want to
  114. use Korean and the |locale| name is "ko", do this:
  115. sh: export LANG=ko
  116. csh: setenv LANG ko
  117. You can put this in your ~/.profile or ~/.cshrc file to always use it.
  118. To use a locale in Vim only, use the |:language| command: >
  119. :language ko
  120. Put this in your |init.vim| file to use it always.
  121. Or specify $LANG when starting Vim:
  122. sh: LANG=ko vim {vim-arguments}
  123. csh: env LANG=ko vim {vim-arguments}
  124. You could make a small shell script for this.
  125. ==============================================================================
  126. Encoding *mbyte-encoding*
  127. In Nvim UTF-8 is always used internally to encode characters.
  128. This applies to all the places where text is used, including buffers (files
  129. loaded into memory), registers and variables.
  130. *charset* *codeset*
  131. Charset is another name for encoding. There are subtle differences, but these
  132. don't matter when using Vim. "codeset" is another similar name.
  133. Each character is encoded as one or more bytes. When all characters are
  134. encoded with one byte, we call this a single-byte encoding. The most often
  135. used one is called "latin1". This limits the number of characters to 256.
  136. Some of these are control characters, thus even fewer can be used for text.
  137. When some characters use two or more bytes, we call this a multibyte
  138. encoding. This allows using much more than 256 characters, which is required
  139. for most East Asian languages.
  140. Most multibyte encodings use one byte for the first 127 characters. These
  141. are equal to ASCII, which makes it easy to exchange plain-ASCII text, no
  142. matter what language is used. Thus you might see the right text even when the
  143. encoding was set wrong.
  144. *encoding-names*
  145. Vim can edit files in different character encodings. There are three major groups:
  146. 1 8bit Single-byte encodings, 256 different characters. Mostly used
  147. in USA and Europe. Example: ISO-8859-1 (Latin1). All
  148. characters occupy one screen cell only.
  149. 2 2byte Double-byte encodings, over 10000 different characters.
  150. Mostly used in Asian countries. Example: euc-kr (Korean)
  151. The number of screen cells is equal to the number of bytes
  152. (except for euc-jp when the first byte is 0x8e).
  153. u Unicode Universal encoding, can replace all others. ISO 10646.
  154. Millions of different characters. Example: UTF-8. The
  155. relation between bytes and screen cells is complex.
  156. Only UTF-8 is used by Vim internally. But files in other
  157. encodings can be edited by using conversion, see 'fileencoding'.
  158. Recognized 'fileencoding' values include: *encoding-values*
  159. 1 latin1 8-bit characters (ISO 8859-1, also used for cp1252)
  160. 1 iso-8859-n ISO_8859 variant (n = 2 to 15)
  161. 1 koi8-r Russian
  162. 1 koi8-u Ukrainian
  163. 1 macroman MacRoman (Macintosh encoding)
  164. 1 8bit-{name} any 8-bit encoding (Vim specific name)
  165. 1 cp437 similar to iso-8859-1
  166. 1 cp737 similar to iso-8859-7
  167. 1 cp775 Baltic
  168. 1 cp850 similar to iso-8859-4
  169. 1 cp852 similar to iso-8859-1
  170. 1 cp855 similar to iso-8859-2
  171. 1 cp857 similar to iso-8859-5
  172. 1 cp860 similar to iso-8859-9
  173. 1 cp861 similar to iso-8859-1
  174. 1 cp862 similar to iso-8859-1
  175. 1 cp863 similar to iso-8859-8
  176. 1 cp865 similar to iso-8859-1
  177. 1 cp866 similar to iso-8859-5
  178. 1 cp869 similar to iso-8859-7
  179. 1 cp874 Thai
  180. 1 cp1250 Czech, Polish, etc.
  181. 1 cp1251 Cyrillic
  182. 1 cp1253 Greek
  183. 1 cp1254 Turkish
  184. 1 cp1255 Hebrew
  185. 1 cp1256 Arabic
  186. 1 cp1257 Baltic
  187. 1 cp1258 Vietnamese
  188. 1 cp{number} MS-Windows: any installed single-byte codepage
  189. 2 cp932 Japanese (Windows only)
  190. 2 euc-jp Japanese
  191. 2 sjis Japanese
  192. 2 cp949 Korean
  193. 2 euc-kr Korean
  194. 2 cp936 simplified Chinese (Windows only)
  195. 2 euc-cn simplified Chinese
  196. 2 cp950 traditional Chinese (alias for big5)
  197. 2 big5 traditional Chinese (alias for cp950)
  198. 2 euc-tw traditional Chinese
  199. 2 2byte-{name} any double-byte encoding (Vim-specific name)
  200. 2 cp{number} MS-Windows: any installed double-byte codepage
  201. u utf-8 32 bit UTF-8 encoded Unicode (ISO/IEC 10646-1)
  202. u ucs-2 16 bit UCS-2 encoded Unicode (ISO/IEC 10646-1)
  203. u ucs-2le like ucs-2, little endian
  204. u utf-16 ucs-2 extended with double-words for more characters
  205. u utf-16le like utf-16, little endian
  206. u ucs-4 32 bit UCS-4 encoded Unicode (ISO/IEC 10646-1)
  207. u ucs-4le like ucs-4, little endian
  208. The {name} can be any encoding name that your system supports. It is passed
  209. to iconv() to convert between UTF-8 and the encoding of the file.
  210. For MS-Windows "cp{number}" means using codepage {number}.
  211. Examples: >
  212. :set fileencoding=8bit-cp1252
  213. :set fileencoding=2byte-cp932
  214. The MS-Windows codepage 1252 is very similar to latin1. For practical reasons
  215. the same encoding is used and it's called latin1. 'isprint' can be used to
  216. display the characters 0x80 - 0xA0 or not.
  217. Several aliases can be used, they are translated to one of the names above.
  218. Incomplete list:
  219. 1 ansi same as latin1 (obsolete, for backward compatibility)
  220. 2 japan Japanese: "euc-jp"
  221. 2 korea Korean: "euc-kr"
  222. 2 prc simplified Chinese: "euc-cn"
  223. 2 chinese same as "prc"
  224. 2 taiwan traditional Chinese: "euc-tw"
  225. u utf8 same as utf-8
  226. u unicode same as ucs-2
  227. u ucs2be same as ucs-2 (big endian)
  228. u ucs-2be same as ucs-2 (big endian)
  229. u ucs-4be same as ucs-4 (big endian)
  230. u utf-32 same as ucs-4
  231. u utf-32le same as ucs-4le
  232. default the encoding of the current locale.
  233. For the UCS codes the byte order matters. This is tricky, use UTF-8 whenever
  234. you can. The default is to use big-endian (most significant byte comes
  235. first):
  236. name bytes char ~
  237. ucs-2 11 22 1122
  238. ucs-2le 22 11 1122
  239. ucs-4 11 22 33 44 11223344
  240. ucs-4le 44 33 22 11 11223344
  241. On MS-Windows systems you often want to use "ucs-2le", because it uses little
  242. endian UCS-2.
  243. There are a few encodings which are similar, but not exactly the same. Vim
  244. treats them as if they were different encodings, so that conversion will be
  245. done when needed. You might want to use the similar name to avoid conversion
  246. or when conversion is not possible:
  247. cp932, shift-jis, sjis
  248. cp936, euc-cn
  249. CONVERSION *charset-conversion*
  250. Vim will automatically convert from one to another encoding in several places:
  251. - When reading a file and 'fileencoding' is different from "utf-8"
  252. - When writing a file and 'fileencoding' is different from "utf-8"
  253. - When displaying messages and the encoding used for LC_MESSAGES differs from
  254. "utf-8" (requires a gettext version that supports this).
  255. - When reading a Vim script where |:scriptencoding| is different from
  256. "utf-8".
  257. Most of these require iconv. Conversion for reading and writing files may
  258. also be specified with the 'charconvert' option.
  259. Useful utilities for converting the charset:
  260. All: iconv
  261. GNU iconv can convert most encodings. Unicode is used as the
  262. intermediate encoding, which allows conversion from and to all other
  263. encodings. See https://directory.fsf.org/wiki/Libiconv.
  264. *mbyte-conversion*
  265. When reading and writing files in an encoding different from "utf-8",
  266. conversion needs to be done. These conversions are supported:
  267. - All conversions between Latin-1 (ISO-8859-1), UTF-8, UCS-2 and UCS-4 are
  268. handled internally.
  269. - For MS-Windows, conversion from and
  270. to any codepage should work.
  271. - Conversion specified with 'charconvert'
  272. - Conversion with the iconv library, if it is available.
  273. Old versions of GNU iconv() may cause the conversion to fail (they
  274. request a very large buffer, more than Vim is willing to provide).
  275. Try getting another iconv() implementation.
  276. ==============================================================================
  277. Input with a keymap *mbyte-keymap*
  278. When the keyboard doesn't produce the characters you want to enter in your
  279. text, you can use the 'keymap' option. This will translate one or more
  280. (English) characters to another (non-English) character. This only happens
  281. when typing text, not when typing Vim commands. This avoids having to switch
  282. between two keyboard settings.
  283. The value of the 'keymap' option specifies a keymap file to use. The name of
  284. this file is one of these two:
  285. keymap/{keymap}_utf-8.vim
  286. keymap/{keymap}.vim
  287. Here {keymap} is the value of the 'keymap' option.
  288. The file name with "utf-8" included is tried first.
  289. 'runtimepath' is used to find these files. To see an overview of all
  290. available keymap files, use this: >
  291. :echo globpath(&rtp, "keymap/*.vim")
  292. In Insert and Command-line mode you can use CTRL-^ to toggle between using the
  293. keyboard map or not. |i_CTRL-^| |c_CTRL-^|
  294. This flag is remembered for Insert mode with the 'iminsert' option. When
  295. leaving and entering Insert mode the previous value is used. The same value
  296. is also used for commands that take a single character argument, like |f| and
  297. |r|.
  298. For Command-line mode the flag is NOT remembered. You are expected to type an
  299. Ex command first, which is ASCII.
  300. For typing search patterns the 'imsearch' option is used. It can be set to
  301. use the same value as for 'iminsert'.
  302. *lCursor*
  303. It is possible to give the GUI cursor another color when the language mappings
  304. are being used. This is disabled by default, to avoid that the cursor becomes
  305. invisible when you use a non-standard background color. Here is an example to
  306. use a brightly colored cursor: >
  307. :highlight Cursor guifg=NONE guibg=Green
  308. :highlight lCursor guifg=NONE guibg=Cyan
  309. <
  310. *keymap-file-format* *:loadk* *:loadkeymap* *E105* *E791*
  311. The keymap file looks something like this: >
  312. " Maintainer: name <email@address>
  313. " Last Changed: 2001 Jan 1
  314. let b:keymap_name = "short"
  315. loadkeymap
  316. a A
  317. b B comment
  318. The lines starting with a " are comments and will be ignored. Blank lines are
  319. also ignored. The lines with the mappings may have a comment after the useful
  320. text.
  321. The "b:keymap_name" can be set to a short name, which will be shown in the
  322. status line. The idea is that this takes less room than the value of
  323. 'keymap', which might be long to distinguish between different languages,
  324. keyboards and encodings.
  325. The actual mappings are in the lines below "loadkeymap". In the example "a"
  326. is mapped to "A" and "b" to "B". Thus the first item is mapped to the second
  327. item. This is done for each line, until the end of the file.
  328. These items are exactly the same as what can be used in a |:lmap| command,
  329. using "<buffer>" to make the mappings local to the buffer.
  330. You can check the result with this command: >
  331. :lmap
  332. The two items must be separated by white space. You cannot include white
  333. space inside an item, use the special names "<Tab>" and "<Space>" instead.
  334. The length of the two items together must not exceed 200 bytes.
  335. It's possible to have more than one character in the first column. This works
  336. like a dead key. Example: >
  337. 'a á
  338. Since Vim doesn't know if the next character after a quote is really an "a",
  339. it will wait for the next character. To be able to insert a single quote,
  340. also add this line: >
  341. '' '
  342. Since the mapping is defined with |:lmap| the resulting quote will not be
  343. used for the start of another character defined in the 'keymap'.
  344. It can be used in a standard |:imap| mapping.
  345. The "accents" keymap uses this. *keymap-accents*
  346. The first column can also be in |<>| form:
  347. <C-c> Ctrl-C
  348. <A-c> Alt-c
  349. <A-C> Alt-C
  350. Note that the Alt mappings may not work, depending on your keyboard and
  351. terminal.
  352. Although it's possible to have more than one character in the second column,
  353. this is unusual. But you can use various ways to specify the character: >
  354. A a literal character
  355. A <char-97> decimal value
  356. A <char-0x61> hexadecimal value
  357. A <char-0141> octal value
  358. x <Space> special key name
  359. The characters are assumed to be encoded in UTF-8.
  360. It's possible to use ":scriptencoding" when all characters are given
  361. literally. That doesn't work when using the <char-> construct, because the
  362. conversion is done on the keymap file, not on the resulting character.
  363. The lines after "loadkeymap" are interpreted with 'cpoptions' set to "C".
  364. This means that continuation lines are not used and a backslash has a special
  365. meaning in the mappings. Examples: >
  366. " a comment line
  367. \" x maps " to x
  368. \\ y maps \ to y
  369. If you write a keymap file that will be useful for others, consider submitting
  370. it to the Vim maintainer for inclusion in the distribution:
  371. <maintainer@vim.org>
  372. HEBREW KEYMAP *keymap-hebrew*
  373. This file explains what characters are available in UTF-8 and CP1255 encodings,
  374. and what the keymaps are to get those characters:
  375. glyph encoding keymap ~
  376. Char UTF-8 cp1255 hebrew hebrewp name ~
  377. א 0x5d0 0xe0 t a ´alef
  378. ב 0x5d1 0xe1 c b bet
  379. ג 0x5d2 0xe2 d g gimel
  380. ד 0x5d3 0xe3 s d dalet
  381. ה 0x5d4 0xe4 v h he
  382. ו 0x5d5 0xe5 u v vav
  383. ז 0x5d6 0xe6 z z zayin
  384. ח 0x5d7 0xe7 j j het
  385. ט 0x5d8 0xe8 y T tet
  386. י 0x5d9 0xe9 h y yod
  387. ך 0x5da 0xea l K kaf sofit
  388. כ 0x5db 0xeb f k kaf
  389. ל 0x5dc 0xec k l lamed
  390. ם 0x5dd 0xed o M mem sofit
  391. מ 0x5de 0xee n m mem
  392. ן 0x5df 0xef i N nun sofit
  393. נ 0x5e0 0xf0 b n nun
  394. ס 0x5e1 0xf1 x s samech
  395. ע 0x5e2 0xf2 g u `ayin
  396. ף 0x5e3 0xf3 ; P pe sofit
  397. פ 0x5e4 0xf4 p p pe
  398. ץ 0x5e5 0xf5 . X tsadi sofit
  399. צ 0x5e6 0xf6 m x tsadi
  400. ק 0x5e7 0xf7 e q qof
  401. ר 0x5e8 0xf8 r r resh
  402. ש 0x5e9 0xf9 a w shin
  403. ת 0x5ea 0xfa , t tav
  404. Vowel marks and special punctuation:
  405. הְ 0x5b0 0xc0 A: A: sheva
  406. הֱ 0x5b1 0xc1 HE HE hataf segol
  407. הֲ 0x5b2 0xc2 HA HA hataf patah
  408. הֳ 0x5b3 0xc3 HO HO hataf qamats
  409. הִ 0x5b4 0xc4 I I hiriq
  410. הֵ 0x5b5 0xc5 AY AY tsere
  411. הֶ 0x5b6 0xc6 E E segol
  412. הַ 0x5b7 0xc7 AA AA patah
  413. הָ 0x5b8 0xc8 AO AO qamats
  414. הֹ 0x5b9 0xc9 O O holam
  415. הֻ 0x5bb 0xcb U U qubuts
  416. כּ 0x5bc 0xcc D D dagesh
  417. הֽ 0x5bd 0xcd ]T ]T meteg
  418. ה־ 0x5be 0xce ]Q ]Q maqaf
  419. בֿ 0x5bf 0xcf ]R ]R rafe
  420. ב׀ 0x5c0 0xd0 ]p ]p paseq
  421. שׁ 0x5c1 0xd1 SR SR shin-dot
  422. שׂ 0x5c2 0xd2 SL SL sin-dot
  423. ׃ 0x5c3 0xd3 ]P ]P sof-pasuq
  424. װ 0x5f0 0xd4 VV VV double-vav
  425. ױ 0x5f1 0xd5 VY VY vav-yod
  426. ײ 0x5f2 0xd6 YY YY yod-yod
  427. The following are only available in UTF-8
  428. Cantillation marks:
  429. glyph
  430. Char UTF-8 hebrew name
  431. ב֑ 0x591 C: etnahta
  432. ב֒ 0x592 Cs segol
  433. ב֓ 0x593 CS shalshelet
  434. ב֔ 0x594 Cz zaqef qatan
  435. ב֕ 0x595 CZ zaqef gadol
  436. ב֖ 0x596 Ct tipeha
  437. ב֗ 0x597 Cr revia
  438. ב֘ 0x598 Cq zarqa
  439. ב֙ 0x599 Cp pashta
  440. ב֚ 0x59a C! yetiv
  441. ב֛ 0x59b Cv tevir
  442. ב֜ 0x59c Cg geresh
  443. ב֝ 0x59d C* geresh qadim
  444. ב֞ 0x59e CG gershayim
  445. ב֟ 0x59f CP qarnei-parah
  446. ב֪ 0x5aa Cy yerach-ben-yomo
  447. ב֫ 0x5ab Co ole
  448. ב֬ 0x5ac Ci iluy
  449. ב֭ 0x5ad Cd dehi
  450. ב֮ 0x5ae Cn zinor
  451. ב֯ 0x5af CC masora circle
  452. Combining forms:
  453. ﬠ 0xfb20 X` Alternative `ayin
  454. ﬡ 0xfb21 X' Alternative ´alef
  455. ﬢ 0xfb22 X-d Alternative dalet
  456. ﬣ 0xfb23 X-h Alternative he
  457. ﬤ 0xfb24 X-k Alternative kaf
  458. ﬥ 0xfb25 X-l Alternative lamed
  459. ﬦ 0xfb26 X-m Alternative mem-sofit
  460. ﬧ 0xfb27 X-r Alternative resh
  461. ﬨ 0xfb28 X-t Alternative tav
  462. ﬩ 0xfb29 X-+ Alternative plus
  463. שׁ 0xfb2a XW shin+shin-dot
  464. שׂ 0xfb2b Xw shin+sin-dot
  465. שּׁ 0xfb2c X..W shin+shin-dot+dagesh
  466. שּׂ 0xfb2d X..w shin+sin-dot+dagesh
  467. אַ 0xfb2e XA alef+patah
  468. אָ 0xfb2f XO alef+qamats
  469. אּ 0xfb30 XI alef+hiriq (mapiq)
  470. בּ 0xfb31 X.b bet+dagesh
  471. גּ 0xfb32 X.g gimel+dagesh
  472. דּ 0xfb33 X.d dalet+dagesh
  473. הּ 0xfb34 X.h he+dagesh
  474. וּ 0xfb35 Xu vav+dagesh
  475. זּ 0xfb36 X.z zayin+dagesh
  476. טּ 0xfb38 X.T tet+dagesh
  477. יּ 0xfb39 X.y yud+dagesh
  478. ךּ 0xfb3a X.K kaf sofit+dagesh
  479. כּ 0xfb3b X.k kaf+dagesh
  480. לּ 0xfb3c X.l lamed+dagesh
  481. מּ 0xfb3e X.m mem+dagesh
  482. נּ 0xfb40 X.n nun+dagesh
  483. סּ 0xfb41 X.s samech+dagesh
  484. ףּ 0xfb43 X.P pe sofit+dagesh
  485. פּ 0xfb44 X.p pe+dagesh
  486. צּ 0xfb46 X.x tsadi+dagesh
  487. קּ 0xfb47 X.q qof+dagesh
  488. רּ 0xfb48 X.r resh+dagesh
  489. שּ 0xfb49 X.w shin+dagesh
  490. תּ 0xfb4a X.t tav+dagesh
  491. וֹ 0xfb4b Xo vav+holam
  492. בֿ 0xfb4c XRb bet+rafe
  493. כֿ 0xfb4d XRk kaf+rafe
  494. פֿ 0xfb4e XRp pe+rafe
  495. ﭏ 0xfb4f Xal alef-lamed
  496. ==============================================================================
  497. Using UTF-8 *mbyte-utf8* *UTF-8* *utf-8* *utf8*
  498. *Unicode* *unicode*
  499. The Unicode character set was designed to include all characters from other
  500. character sets. Therefore it is possible to write text in any language using
  501. Unicode (with a few rarely used languages excluded). And it's mostly possible
  502. to mix these languages in one file, which is impossible with other encodings.
  503. Unicode can be encoded in several ways. The most popular one is UTF-8, which
  504. uses one or more bytes for each character and is backwards compatible with
  505. ASCII. On MS-Windows UTF-16 is also used (previously UCS-2), which uses
  506. 16-bit words. Vim can support all of these encodings, but always uses UTF-8
  507. internally.
  508. Vim has comprehensive UTF-8 support. It works well in:
  509. - xterm with UTF-8 support enabled
  510. - MS-Windows GUI
  511. - several other platforms
  512. Double-width characters are supported. Works best with 'guifontwide'. When
  513. using only 'guifont' the wide characters are drawn in the normal width and
  514. a space to fill the gap.
  515. *bom-bytes*
  516. When reading a file a BOM (Byte Order Mark) can be used to recognize the
  517. Unicode encoding:
  518. EF BB BF UTF-8
  519. FE FF UTF-16 big endian
  520. FF FE UTF-16 little endian
  521. 00 00 FE FF UTF-32 big endian
  522. FF FE 00 00 UTF-32 little endian
  523. UTF-8 is the recommended encoding. Note that it's difficult to tell UTF-16
  524. and UTF-32 apart. UTF-16 is often used on MS-Windows, UTF-32 is not
  525. widespread as file format.
  526. *mbyte-combining* *mbyte-composing*
  527. A composing or combining character is used to change the meaning of the
  528. character before it. The combining characters are drawn on top of the
  529. preceding character.
  530. Nvim largely follows the definition of extended grapheme clusters in UAX#29
  531. in the Unicode standard, with some modifications: An ascii char will always
  532. start a new cluster. In addition 'arabicshape' enables the combining of some
  533. arabic letters, when they are shaped to be displayed together in a single cell.
  534. Too big combined characters cannot be displayed, but they can still be
  535. inspected using the |g8| and |ga| commands described below.
  536. When editing text a composing character is mostly considered part of the
  537. preceding character. For example "x" will delete a character and its
  538. following composing characters by default.
  539. If the 'delcombine' option is on, then pressing 'x' will delete the combining
  540. characters, one at a time, then the base character. But when inserting, you
  541. type the first character and the following composing characters separately,
  542. after which they will be joined. The "r" command will not allow you to type a
  543. combining character, because it doesn't know one is coming. Use "R" instead.
  544. Bytes which are not part of a valid UTF-8 byte sequence are handled like a
  545. single character and displayed as <xx>, where "xx" is the hex value of the
  546. byte.
  547. Overlong sequences are not handled specially and displayed like a valid
  548. character. However, search patterns may not match on an overlong sequence.
  549. (an overlong sequence is where more bytes are used than required for the
  550. character.) An exception is NUL (zero) which is displayed as "<00>".
  551. In the file and buffer the full range of Unicode characters can be used (31
  552. bits). However, displaying only works for the characters present in the
  553. selected font.
  554. Useful commands:
  555. - "ga" shows the decimal, hexadecimal and octal value of the character under
  556. the cursor. If there are composing characters these are shown too. (If the
  557. message is truncated, use ":messages").
  558. - "g8" shows the bytes used in a UTF-8 character, also the composing
  559. characters, as hex numbers.
  560. - ":set fileencodings=" forces using UTF-8 for all files. The
  561. default is to automatically detect the encoding of a file.
  562. STARTING VIM
  563. You might want to select the font used for the menus. Unfortunately this
  564. doesn't always work. See the system specific remarks below, and 'langmenu'.
  565. USING UTF-8 IN X-WINDOWS *utf-8-in-xwindows*
  566. You need to specify a font to be used. For double-wide characters another
  567. font is required, which is exactly twice as wide. There are three ways to do
  568. this:
  569. 1. Set 'guifont' and let Vim find a matching 'guifontwide'
  570. 2. Set 'guifont' and 'guifontwide'
  571. See the documentation for each option for details. Example: >
  572. :set guifont=-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1
  573. You might also want to set the font used for the menus. This only works for
  574. Motif. Use the ":hi Menu font={fontname}" command for this. |:highlight|
  575. TYPING UTF-8 *utf-8-typing*
  576. If you are using X-Windows, you should find an input method that supports
  577. UTF-8.
  578. If your system does not provide support for typing UTF-8, you can use the
  579. 'keymap' feature. This allows writing a keymap file, which defines a UTF-8
  580. character as a sequence of ASCII characters. See |mbyte-keymap|.
  581. If everything else fails, you can type any character as four hex bytes: >
  582. CTRL-V u 1234
  583. "1234" is interpreted as a hex number. You must type four characters, prepend
  584. a zero if necessary.
  585. COMMAND ARGUMENTS *utf-8-char-arg*
  586. Commands like |f|, |F|, |t| and |r| take an argument of one character. For
  587. UTF-8 this argument may include one or two composing characters. These need
  588. to be produced together with the base character, Vim doesn't wait for the next
  589. character to be typed to find out if it is a composing character or not.
  590. Using 'keymap' or |:lmap| is a nice way to type these characters.
  591. The commands that search for a character in a line handle composing characters
  592. as follows. When searching for a character without a composing character,
  593. this will find matches in the text with or without composing characters. When
  594. searching for a character with a composing character, this will only find
  595. matches with that composing character. It was implemented this way, because
  596. not everybody is able to type a composing character.
  597. ==============================================================================
  598. Overview of options *mbyte-options*
  599. These options are relevant for editing multibyte files.
  600. 'fileencoding' Encoding of a file. When it's different from "utf-8"
  601. conversion is done when reading or writing the file.
  602. 'fileencodings' List of possible encodings of a file. When opening a file
  603. these will be tried and the first one that doesn't cause an
  604. error is used for 'fileencoding'.
  605. 'charconvert' Expression used to convert files from one encoding to another.
  606. 'formatoptions' The 'm' flag can be included to have formatting break a line
  607. at a multibyte character of 256 or higher. Thus is useful for
  608. languages where a sequence of characters can be broken
  609. anywhere.
  610. 'keymap' Specify the name of a keyboard mapping.
  611. ==============================================================================
  612. Contributions specifically for the multibyte features by:
  613. Chi-Deok Hwang <hwang@mizi.co.kr>
  614. SungHyun Nam <goweol@gmail.com>
  615. K.Nagano <nagano@atese.advantest.co.jp>
  616. Taro Muraoka <koron@tka.att.ne.jp>
  617. Yasuhiro Matsumoto <mattn@mail.goo.ne.jp>
  618. vim:tw=78:ts=8:noet:ft=help:norl: