The digraph feature in vim allows entering control codes and dicrital marks that would normally be impossible to type on an ascii keyboard.
Listing
:dig[raphs][!] Show currently defined digraphs.
With [!] headers are used to make it a bit easier to
find a specific character.
Using
There are two methods to enter digraphs:
CTRL-K {char1} {char2}
{char1} <BS> {char2}
The first is always available; the second only when the digraph option is
set.
Common digraphs
² 2S superscript two
Ā A- complement of A
∈ (- element of
∉ !( not element of
∋ -) contains as member
⊆ (_ subset of or equal to
⊊ (~ proper subset of
⊇ )_ superset of or equal to
⊋ )~ proper superset of
∅ /0 empty set
∩ (U intersection
∪ )U union
™ TM trade mark sign
ā a- mandarin first tone
á a' mandarin second tone
ǎ a< mandarin third tone
à a` mandarin forth tone
Creating new digraph's (from lua)
vim.api.nvim_command('dig (~ 8842')
vim.api.nvim_command('dig )~ 8843')
vim.api.nvim_command('dig !( 8713')