Home Explore Blog CI



neovim

2nd chunk of `runtime/doc/digraph.txt`
19c1e8bbe572bb00ed98052fa825a54a42226691030ae19f0000000100000fa6
 key.  This is not a digraph.

Once you have entered the digraph, Vim treats the character like a normal
character that occupies only one character in the file and on the screen.
Example: >
	'B' <BS> 'B'	will enter the broken '|' character (166)
	'a' <BS> '>'	will enter an 'a' with a circumflex (226)
	CTRL-K '-' '-'	will enter a soft hyphen (173)

The current digraphs are listed with the ":digraphs" command.  Some of the
default ones are listed below |digraph-table|.

For CTRL-K, there is one general digraph: CTRL-K <Space> {char} will enter
{char} with the highest bit set.  You can use this to enter meta-characters.

The <Esc> character cannot be part of a digraph.  When hitting <Esc>, Vim
stops digraph entry and ends Insert mode or Command-line mode, just like
hitting an <Esc> out of digraph context.  Use CTRL-V 155 to enter meta-ESC
(CSI).

If you accidentally typed an 'a' that should be an 'e', you will type 'a' <BS>
'e'.  But that is a digraph, so you will not get what you want.  To correct
this, you will have to type <BS> e again.  To avoid this don't set the
'digraph' option and use CTRL-K to enter digraphs.

You may have problems using Vim with characters which have a value above 128.
For example: You insert ue (u-umlaut) and the editor echoes \334 in Insert
mode.  After leaving the Insert mode everything is fine.  On some Unix systems
this means you have to define the environment-variable LC_CTYPE.  If you are
using csh, then put the following line in your .cshrc: >
	setenv LC_CTYPE en_US.utf8
(or similar for a different language or country). The value must be a valid
locale on your system, i.e. on Unix-like systems it must be present in the
output of >
	locale -a

==============================================================================
3. Default digraphs					*digraphs-default*

Vim comes with a set of default digraphs.  Check the output of ":digraphs" to
see them.

On most systems Vim uses the same digraphs.  They work for the Unicode and
ISO-8859-1 character sets.  These default digraphs are taken from the RFC1345
mnemonics (with some additions).  To make it easy to remember the mnemonic,
the second character has a standard meaning:

	char name		char	meaning ~
	Exclamation mark	!	Grave
	Apostrophe		'	Acute accent
	Greater-Than sign	>	Circumflex accent
	Question mark		?	Tilde
	Hyphen-Minus		-	Macron
	Left parenthesis	(	Breve
	Full stop		.	Dot above
	Colon			:	Diaeresis
	Comma			,	Cedilla
	Underline		_	Underline
	Solidus			/	Stroke
	Quotation mark		"	Double acute accent
	Semicolon		;	Ogonek
	Less-Than sign		<	Caron
	Zero			0	Ring above
	Two			2	Hook
	Nine			9	Horn

	Equals			=	Cyrillic (= used as second char)
	Asterisk		*	Greek
	Percent sign		%	Greek/Cyrillic special
	Plus			+	smalls: Arabic, capitals: Hebrew
	Three			3	some Latin/Greek/Cyrillic letters
	Four			4	Bopomofo
	Five			5	Hiragana
	Six			6	Katakana

Example: a: is ä  and o: is ö

These are the RFC1345 digraphs for the one-byte characters.  See the output of
":digraphs" for the others.

EURO
							*euro* *euro-digraph*
Exception: RFC1345 doesn't specify the euro sign.  In Vim the digraph =e was
added for this.  Note the difference between latin1, where the digraph Cu is
used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is
used for the euro sign, while both of them are the character 164, 0xa4.  For
compatibility with zsh Eu can also be used for the euro sign.

ROUBLE

The rouble sign was added in 2014 as 0x20bd.  Vim supports the digraphs =R and
=P for this.  Note that R= and P= are other characters.

QUADRUPLE PRIME

The quadruple prime using the digraph 4' was added in 2023.  Although it is
not part of RFC 1345, it supplements the existing digraph implementation as
there already exist digraphs for PRIME, DOUBLE PRIME and TRIPLE PRIME using
the 1', 2' and 3' digraphs.

						*digraph-table* *digraph-table-mbyte*
>
  char  digraph	hex	dec	official name
  ^@	NU	0x00	  0	NULL (NUL)
  ^A	SH	0x01	  1	START OF HEADING (SOH)
  ^B	SX	0x02

Title: Digraph Usage, Default Digraphs, and Character Encoding Issues
Summary
This section discusses how Vim handles digraphs, including correcting mistakes, and avoiding issues with characters above 128 by setting the LC_CTYPE environment variable. It details the default digraphs included with Vim, based on RFC1345 mnemonics, and explains common patterns in the second character's meaning. It covers specific digraphs for the euro and rouble signs, and quadruple prime, and notes that the output of ":digraphs" command can list all available digraphs.