Digraphs: Non-ASCII Characters

Do you say that the Messiah is composed by George Frideric Händel, not George Frideric Handel? Do you think your résumé conveys a little more cachet than a resume? Use Vim’s digraphs to enter special characters.

Even English-language text files occasionally need a special character, especially when making references to a globalized world. Text files in languages other than English need scads of special characters.

Vim lets you enter special characters in a number of ways, and two of them are relatively straightforward and intuitive. Both rely on defining a digraph through a prefix (CTRL-K) or the use of the BS (Backspace) key between two keyboard characters. (The other methods are more suited to entering characters by their raw numerical values, specified as decimal, hexadecimal, or octal numbers. While powerful, these methods do not lend themselves to easy mnemonics for digraphs.)

Note

The term digraph traditionally describes a two-letter combination that represents a single phonetic sound, such as the ph in “digraph” or “phonetic.” Vim borrows the notion of “two-letter” combinations to describe its input mechanism for characters with special characteristics, typically accents or other markings such as the umlaut on ä. These special marks are properly called diacritics, or diacritical marks. In other words, Vim uses digraphs to create diacritics. Glad we could clear that up.

The first input method for diacritics is a three-character sequence consisting ...

Get Learning the vi and Vim Editors, 7th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.