vimunicodedigraphs

Inserting unicode characters in vim


I would like a quick and easy way to insert certain unicode characters into text files with vim that I use often, for example, the British Pound Sterling and the tick characters instead of typing:

i C-v u00A3 = £
i C-v u2713 = ✓

Solution

  • TL;DR

    After some digging around, I was able to come up with these:

    Digraph Shortlist

    Insert Digraphs
    i C-k OK = ✓
    i C-k $$ = £
    i C-k Eu = €
    i C-k XX = ✗
    i C-k TM = ™
    i C-k Co = ©
    i C-k Rg = ®
    i C-k /- = †
    i C-k RT = √
    i C-k *1 = ☆
    i C-k *2 = ★
    i C-k NS =   (non-breaking space)
    
    NB: tmux maps C-k so unmap it for vim in tmux.conf
    

    This new functionality was added to Vim 8.2 released in May 2019.

    These are entered from insert mode using C-k <2letter shortcut>

    Type :digraph or just :dig to display a list of all possible digraphs in Vim.


    P.S.

    Not to be confused with diacritics which are character accents like the German umlaut ü.

    Hope this helps someone out there too.