Merge branch 'vim-with-runtime' into feat/quickfix-title
[vim_extended.git] / runtime / doc / digraph.txt
blob8440a7779fa8aab751079803618d1a2f926b3156
1 *digraph.txt*   For Vim version 7.2.  Last change: 2010 Apr 11
4                   VIM REFERENCE MANUAL    by Bram Moolenaar
7 Digraphs                                        *digraph* *digraphs* *Digraphs*
9 Digraphs are used to enter characters that normally cannot be entered by
10 an ordinary keyboard.  These are mostly printable non-ASCII characters.  The
11 digraphs are easier to remember than the decimal number that can be entered
12 with CTRL-V (see |i_CTRL-V|).
14 There is a brief introduction on digraphs in the user manual: |24.9|
15 An alternative is using the 'keymap' option.
17 1. Defining digraphs    |digraphs-define|
18 2. Using digraphs       |digraphs-use|
19 3. Default digraphs     |digraphs-default|
21 {Vi does not have any of these commands}
23 ==============================================================================
24 1. Defining digraphs                                    *digraphs-define*
26                                                 *:dig* *:digraphs*
27 :dig[raphs]             show currently defined digraphs.
28                                                         *E104* *E39*
29 :dig[raphs] {char1}{char2} {number} ...
30                         Add digraph {char1}{char2} to the list.  {number} is
31                         the decimal representation of the character.  Normally
32                         it is the Unicode character, see |digraph-encoding|.
33                         Example: >
34         :digr e: 235 a: 228
35 <                       Avoid defining a digraph with '_' (underscore) as the
36                         first character, it has a special meaning in the
37                         future.
39 Vim is normally compiled with the |+digraphs| feature.  If the feature is
40 disabled, the ":digraph" command will display an error message.
42 Example of the output of ":digraphs": >
43  TH Þ  222  ss ß  223  a! à  224  a' á  225  a> â  226  a? ã  227  a: ä  228
45 The first two characters in each column are the characters you have to type to
46 enter the digraph.
48 In the middle of each column is the resulting character.  This may be mangled
49 if you look at it on a system that does not support digraphs or if you print
50 this file.
52                                                         *digraph-encoding*
53 The decimal number normally is the Unicode number of the character.  Note that
54 the meaning doesn't change when 'encoding' changes.  The character will be
55 converted from Unicode to 'encoding' when needed.  This does require the
56 conversion to be available, it might fail.  For the NUL character you will see
57 "10".  That's because NUL characters are internally represented with a NL
58 character.  When you write the file it will become a NUL character.
60 When Vim was compiled without the +multi_byte feature, you need to specify the
61 character in the encoding given with 'encoding'.  You might want to use
62 something like this: >
64         if has("multi_byte")
65                 digraph oe 339
66         elseif &encoding == "iso-8859-15"
67                 digraph oe 189
68         endif
70 This defines the "oe" digraph for a character that is number 339 in Unicode
71 and 189 in latin9 (iso-8859-15).
73 ==============================================================================
74 2. Using digraphs                                       *digraphs-use*
76 There are two methods to enter digraphs:                        *i_digraph*
77         CTRL-K {char1} {char2}          or
78         {char1} <BS> {char2}
79 The first is always available; the second only when the 'digraph' option is
80 set.
82 If a digraph with {char1}{char2} does not exist, Vim searches for a digraph
83 {char2}{char1}.  This helps when you don't remember which character comes
84 first.
86 Note that when you enter CTRL-K {char1}, where {char1} is a special key, Vim
87 enters the code for that special key.  This is not a digraph.
89 Once you have entered the digraph, Vim treats the character like a normal
90 character that occupies only one character in the file and on the screen.
91 Example: >
92         'B' <BS> 'B'    will enter the broken '|' character (166)
93         'a' <BS> '>'    will enter an 'a' with a circumflex (226)
94         CTRL-K '-' '-'  will enter a soft hyphen (173)
96 The current digraphs are listed with the ":digraphs" command.  Some of the
97 default ones are listed below |digraph-table|.
99 For CTRL-K, there is one general digraph: CTRL-K <Space> {char} will enter
100 {char} with the highest bit set.  You can use this to enter meta-characters.
102 The <Esc> character cannot be part of a digraph.  When hitting <Esc>, Vim
103 stops digraph entry and ends Insert mode or Command-line mode, just like
104 hitting an <Esc> out of digraph context.  Use CTRL-V 155 to enter meta-ESC
105 (CSI).
107 If you accidentally typed an 'a' that should be an 'e', you will type 'a' <BS>
108 'e'.  But that is a digraph, so you will not get what you want.  To correct
109 this, you will have to type <BS> e again.  To avoid this don't set the
110 'digraph' option and use CTRL-K to enter digraphs.
112 You may have problems using Vim with characters which have a value above 128.
113 For example: You insert ue (u-umlaut) and the editor echoes \334 in Insert
114 mode.  After leaving the Insert mode everything is fine.  Note that fmt
115 removes all characters with a value above 128 from the text being formatted.
116 On some Unix systems this means you have to define the environment-variable
117 LC_CTYPE.  If you are using csh, then put the following line in your .cshrc: >
118         setenv LC_CTYPE iso_8859_1
120 ==============================================================================
121 3. Default digraphs                                     *digraphs-default*
123 Vim comes with a set of default digraphs.  Check the output of ":digraphs" to
124 see them.
126 On most systems Vim uses the same digraphs.  They work for the Unicode and
127 ISO-8859-1 character sets.  These default digraphs are taken from the RFC1345
128 mnemonics.  To make it easy to remember the mnemonic, the second character has
129 a standard meaning:
131         char name               char    meaning ~
132         Exclamation mark        !       Grave
133         Apostrophe              '       Acute accent
134         Greater-Than sign       >       Circumflex accent
135         Question mark           ?       Tilde
136         Hyphen-Minus            -       Macron
137         Left parenthesis        (       Breve
138         Full stop               .       Dot above
139         Colon                   :       Diaeresis
140         Comma                   ,       Cedilla
141         Underline               _       Underline
142         Solidus                 /       Stroke
143         Quotation mark          "       Double acute accent
144         Semicolon               ;       Ogonek
145         Less-Than sign          <       Caron
146         Zero                    0       Ring above
147         Two                     2       Hook
148         Nine                    9       Horn
150         Equals                  =       Cyrillic
151         Asterisk                *       Greek
152         Percent sign            %       Greek/Cyrillic special
153         Plus                    +       smalls: Arabic, capitals: Hebrew
154         Three                   3       some Latin/Greek/Cyrillic letters
155         Four                    4       Bopomofo
156         Five                    5       Hiragana
157         Six                     6       Katakana
159 Example: a: is ä  and o: is ö
161 These are the RFC1345 digraphs for the one-byte characters.  See the output of
162 ":digraphs" for the others.  The characters above 255 are only available when
163 Vim was compiled with the |+multi_byte| feature.
165 EURO
167 Exception: RFC1345 doesn't specify the euro sign.  In Vim the digraph =e was
168 added for this.  Note the difference between latin1, where the digraph Cu is
169 used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is
170 used for the euro sign, while both of them are the character 164, 0xa4.  For
171 compatibility with zsh Eu can also be used for the euro sign.
173                                                         *digraph-table*
174 char  digraph   hex     dec     official name ~
175 ^@      NU      0x00      0     NULL (NUL)
176 ^A      SH      0x01      1     START OF HEADING (SOH)
177 ^B      SX      0x02      2     START OF TEXT (STX)
178 ^C      EX      0x03      3     END OF TEXT (ETX)
179 ^D      ET      0x04      4     END OF TRANSMISSION (EOT)
180 ^E      EQ      0x05      5     ENQUIRY (ENQ)
181 ^F      AK      0x06      6     ACKNOWLEDGE (ACK)
182 ^G      BL      0x07      7     BELL (BEL)
183 ^H      BS      0x08      8     BACKSPACE (BS)
184 ^I      HT      0x09      9     CHARACTER TABULATION (HT)
185 ^@      LF      0x0a     10     LINE FEED (LF)
186 ^K      VT      0x0b     11     LINE TABULATION (VT)
187 ^L      FF      0x0c     12     FORM FEED (FF)
188 ^M      CR      0x0d     13     CARRIAGE RETURN (CR)
189 ^N      SO      0x0e     14     SHIFT OUT (SO)
190 ^O      SI      0x0f     15     SHIFT IN (SI)
191 ^P      DL      0x10     16     DATALINK ESCAPE (DLE)
192 ^Q      D1      0x11     17     DEVICE CONTROL ONE (DC1)
193 ^R      D2      0x12     18     DEVICE CONTROL TWO (DC2)
194 ^S      D3      0x13     19     DEVICE CONTROL THREE (DC3)
195 ^T      D4      0x14     20     DEVICE CONTROL FOUR (DC4)
196 ^U      NK      0x15     21     NEGATIVE ACKNOWLEDGE (NAK)
197 ^V      SY      0x16     22     SYNCHRONOUS IDLE (SYN)
198 ^W      EB      0x17     23     END OF TRANSMISSION BLOCK (ETB)
199 ^X      CN      0x18     24     CANCEL (CAN)
200 ^Y      EM      0x19     25     END OF MEDIUM (EM)
201 ^Z      SB      0x1a     26     SUBSTITUTE (SUB)
202 ^[      EC      0x1b     27     ESCAPE (ESC)
203 ^\      FS      0x1c     28     FILE SEPARATOR (IS4)
204 ^]      GS      0x1d     29     GROUP SEPARATOR (IS3)
205 ^^      RS      0x1e     30     RECORD SEPARATOR (IS2)
206 ^_      US      0x1f     31     UNIT SEPARATOR (IS1)
207         SP      0x20     32     SPACE
208 #       Nb      0x23     35     NUMBER SIGN
209 $       DO      0x24     36     DOLLAR SIGN
210 @       At      0x40     64     COMMERCIAL AT
211 [       <(      0x5b     91     LEFT SQUARE BRACKET
212 \       //      0x5c     92     REVERSE SOLIDUS
213 ]       )>      0x5d     93     RIGHT SQUARE BRACKET
214 ^       '>      0x5e     94     CIRCUMFLEX ACCENT
215 `       '!      0x60     96     GRAVE ACCENT
216 {       (!      0x7b    123     LEFT CURLY BRACKET
217 |       !!      0x7c    124     VERTICAL LINE
218 }       !)      0x7d    125     RIGHT CURLY BRACKET
219 ~       '?      0x7e    126     TILDE
220 ^?      DT      0x7f    127     DELETE (DEL)
221 ~@      PA      0x80    128     PADDING CHARACTER (PAD)
222 ~A      HO      0x81    129     HIGH OCTET PRESET (HOP)
223 ~B      BH      0x82    130     BREAK PERMITTED HERE (BPH)
224 ~C      NH      0x83    131     NO BREAK HERE (NBH)
225 ~D      IN      0x84    132     INDEX (IND)
226 ~E      NL      0x85    133     NEXT LINE (NEL)
227 ~F      SA      0x86    134     START OF SELECTED AREA (SSA)
228 ~G      ES      0x87    135     END OF SELECTED AREA (ESA)
229 ~H      HS      0x88    136     CHARACTER TABULATION SET (HTS)
230 ~I      HJ      0x89    137     CHARACTER TABULATION WITH JUSTIFICATION (HTJ)
231 ~J      VS      0x8a    138     LINE TABULATION SET (VTS)
232 ~K      PD      0x8b    139     PARTIAL LINE FORWARD (PLD)
233 ~L      PU      0x8c    140     PARTIAL LINE BACKWARD (PLU)
234 ~M      RI      0x8d    141     REVERSE LINE FEED (RI)
235 ~N      S2      0x8e    142     SINGLE-SHIFT TWO (SS2)
236 ~O      S3      0x8f    143     SINGLE-SHIFT THREE (SS3)
237 ~P      DC      0x90    144     DEVICE CONTROL STRING (DCS)
238 ~Q      P1      0x91    145     PRIVATE USE ONE (PU1)
239 ~R      P2      0x92    146     PRIVATE USE TWO (PU2)
240 ~S      TS      0x93    147     SET TRANSMIT STATE (STS)
241 ~T      CC      0x94    148     CANCEL CHARACTER (CCH)
242 ~U      MW      0x95    149     MESSAGE WAITING (MW)
243 ~V      SG      0x96    150     START OF GUARDED AREA (SPA)
244 ~W      EG      0x97    151     END OF GUARDED AREA (EPA)
245 ~X      SS      0x98    152     START OF STRING (SOS)
246 ~Y      GC      0x99    153     SINGLE GRAPHIC CHARACTER INTRODUCER (SGCI)
247 ~Z      SC      0x9a    154     SINGLE CHARACTER INTRODUCER (SCI)
248 ~[      CI      0x9b    155     CONTROL SEQUENCE INTRODUCER (CSI)
249 ~\      ST      0x9c    156     STRING TERMINATOR (ST)
250 ~]      OC      0x9d    157     OPERATING SYSTEM COMMAND (OSC)
251 ~^      PM      0x9e    158     PRIVACY MESSAGE (PM)
252 ~_      AC      0x9f    159     APPLICATION PROGRAM COMMAND (APC)
253 |       NS      0xa0    160     NO-BREAK SPACE
254 ¡       !I      0xa1    161     INVERTED EXCLAMATION MARK
255 ¢       Ct      0xa2    162     CENT SIGN
256 £       Pd      0xa3    163     POUND SIGN
257 ¤       Cu      0xa4    164     CURRENCY SIGN
258 ¥       Ye      0xa5    165     YEN SIGN
259 ¦       BB      0xa6    166     BROKEN BAR
260 §       SE      0xa7    167     SECTION SIGN
261 ¨       ':      0xa8    168     DIAERESIS
262 ©       Co      0xa9    169     COPYRIGHT SIGN
263 ª       -a      0xaa    170     FEMININE ORDINAL INDICATOR
264 «       <<      0xab    171     LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
265 ¬       NO      0xac    172     NOT SIGN
266 ­       --      0xad    173     SOFT HYPHEN
267 ®       Rg      0xae    174     REGISTERED SIGN
268 ¯       'm      0xaf    175     MACRON
269 °       DG      0xb0    176     DEGREE SIGN
270 ±       +-      0xb1    177     PLUS-MINUS SIGN
271 ²       2S      0xb2    178     SUPERSCRIPT TWO
272 ³       3S      0xb3    179     SUPERSCRIPT THREE
273 ´       ''      0xb4    180     ACUTE ACCENT
274 µ       My      0xb5    181     MICRO SIGN
275 ¶       PI      0xb6    182     PILCROW SIGN
276 ·       .M      0xb7    183     MIDDLE DOT
277 ¸       ',      0xb8    184     CEDILLA
278 ¹       1S      0xb9    185     SUPERSCRIPT ONE
279 º       -o      0xba    186     MASCULINE ORDINAL INDICATOR
280 »       >>      0xbb    187     RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
281 ¼       14      0xbc    188     VULGAR FRACTION ONE QUARTER
282 ½       12      0xbd    189     VULGAR FRACTION ONE HALF
283 ¾       34      0xbe    190     VULGAR FRACTION THREE QUARTERS
284 ¿       ?I      0xbf    191     INVERTED QUESTION MARK
285 À       A!      0xc0    192     LATIN CAPITAL LETTER A WITH GRAVE
286 Á       A'      0xc1    193     LATIN CAPITAL LETTER A WITH ACUTE
287        A>      0xc2    194     LATIN CAPITAL LETTER A WITH CIRCUMFLEX
288 à      A?      0xc3    195     LATIN CAPITAL LETTER A WITH TILDE
289 Ä       A:      0xc4    196     LATIN CAPITAL LETTER A WITH DIAERESIS
290 Å       AA      0xc5    197     LATIN CAPITAL LETTER A WITH RING ABOVE
291 Æ       AE      0xc6    198     LATIN CAPITAL LETTER AE
292 Ç       C,      0xc7    199     LATIN CAPITAL LETTER C WITH CEDILLA
293 È       E!      0xc8    200     LATIN CAPITAL LETTER E WITH GRAVE
294 É       E'      0xc9    201     LATIN CAPITAL LETTER E WITH ACUTE
295 Ê       E>      0xca    202     LATIN CAPITAL LETTER E WITH CIRCUMFLEX
296 Ë       E:      0xcb    203     LATIN CAPITAL LETTER E WITH DIAERESIS
297 Ì       I!      0xcc    204     LATIN CAPITAL LETTER I WITH GRAVE
298 Í       I'      0xcd    205     LATIN CAPITAL LETTER I WITH ACUTE
299 Π      I>      0xce    206     LATIN CAPITAL LETTER I WITH CIRCUMFLEX
300 Ï       I:      0xcf    207     LATIN CAPITAL LETTER I WITH DIAERESIS
301 Р      D-      0xd0    208     LATIN CAPITAL LETTER ETH (Icelandic)
302 Ñ       N?      0xd1    209     LATIN CAPITAL LETTER N WITH TILDE
303 Ò       O!      0xd2    210     LATIN CAPITAL LETTER O WITH GRAVE
304 Ó       O'      0xd3    211     LATIN CAPITAL LETTER O WITH ACUTE
305 Ô       O>      0xd4    212     LATIN CAPITAL LETTER O WITH CIRCUMFLEX
306 Õ       O?      0xd5    213     LATIN CAPITAL LETTER O WITH TILDE
307 Ö       O:      0xd6    214     LATIN CAPITAL LETTER O WITH DIAERESIS
308 ×       *X      0xd7    215     MULTIPLICATION SIGN
309 Ø       O/      0xd8    216     LATIN CAPITAL LETTER O WITH STROKE
310 Ù       U!      0xd9    217     LATIN CAPITAL LETTER U WITH GRAVE
311 Ú       U'      0xda    218     LATIN CAPITAL LETTER U WITH ACUTE
312 Û       U>      0xdb    219     LATIN CAPITAL LETTER U WITH CIRCUMFLEX
313 Ü       U:      0xdc    220     LATIN CAPITAL LETTER U WITH DIAERESIS
314 Ý       Y'      0xdd    221     LATIN CAPITAL LETTER Y WITH ACUTE
315 Þ       TH      0xde    222     LATIN CAPITAL LETTER THORN (Icelandic)
316 ß       ss      0xdf    223     LATIN SMALL LETTER SHARP S (German)
317 à       a!      0xe0    224     LATIN SMALL LETTER A WITH GRAVE
318 á       a'      0xe1    225     LATIN SMALL LETTER A WITH ACUTE
319 â       a>      0xe2    226     LATIN SMALL LETTER A WITH CIRCUMFLEX
320 ã       a?      0xe3    227     LATIN SMALL LETTER A WITH TILDE
321 ä       a:      0xe4    228     LATIN SMALL LETTER A WITH DIAERESIS
322 å       aa      0xe5    229     LATIN SMALL LETTER A WITH RING ABOVE
323 æ       ae      0xe6    230     LATIN SMALL LETTER AE
324 ç       c,      0xe7    231     LATIN SMALL LETTER C WITH CEDILLA
325 è       e!      0xe8    232     LATIN SMALL LETTER E WITH GRAVE
326 é       e'      0xe9    233     LATIN SMALL LETTER E WITH ACUTE
327 ê       e>      0xea    234     LATIN SMALL LETTER E WITH CIRCUMFLEX
328 ë       e:      0xeb    235     LATIN SMALL LETTER E WITH DIAERESIS
329 ì       i!      0xec    236     LATIN SMALL LETTER I WITH GRAVE
330 í       i'      0xed    237     LATIN SMALL LETTER I WITH ACUTE
331 î       i>      0xee    238     LATIN SMALL LETTER I WITH CIRCUMFLEX
332 ï       i:      0xef    239     LATIN SMALL LETTER I WITH DIAERESIS
333 ð       d-      0xf0    240     LATIN SMALL LETTER ETH (Icelandic)
334 ñ       n?      0xf1    241     LATIN SMALL LETTER N WITH TILDE
335 ò       o!      0xf2    242     LATIN SMALL LETTER O WITH GRAVE
336 ó       o'      0xf3    243     LATIN SMALL LETTER O WITH ACUTE
337 ô       o>      0xf4    244     LATIN SMALL LETTER O WITH CIRCUMFLEX
338 õ       o?      0xf5    245     LATIN SMALL LETTER O WITH TILDE
339 ö       o:      0xf6    246     LATIN SMALL LETTER O WITH DIAERESIS
340 ÷       -:      0xf7    247     DIVISION SIGN
341 ø       o/      0xf8    248     LATIN SMALL LETTER O WITH STROKE
342 ù       u!      0xf9    249     LATIN SMALL LETTER U WITH GRAVE
343 ú       u'      0xfa    250     LATIN SMALL LETTER U WITH ACUTE
344 û       u>      0xfb    251     LATIN SMALL LETTER U WITH CIRCUMFLEX
345 ü       u:      0xfc    252     LATIN SMALL LETTER U WITH DIAERESIS
346 ý       y'      0xfd    253     LATIN SMALL LETTER Y WITH ACUTE
347 þ       th      0xfe    254     LATIN SMALL LETTER THORN (Icelandic)
348 ÿ       y:      0xff    255     LATIN SMALL LETTER Y WITH DIAERESIS
350  vim:tw=78:ts=8:ft=help:norl: