Forked from https://github.com/srackham/digraph-picker.nvim A Neovim plugin for browsing and inserting digraphs.
Find a file
2026-09-23 18:57:26 +02:00
lua/digraph-picker Removed special keybind preventing the use of normal when inside the 2026-09-23 18:57:26 +02:00
tests tests: check invalid digraph as not valid; added assert test function 2025-04-30 14:12:47 +12:00
CHANGELOG.md add CHANGELOG 2025-03-31 17:33:37 +13:00
LICENSE add LICENSE file 2025-03-24 20:15:52 +13:00
Makefile tests: retun shell exit code of 1 if tests fail 2025-03-27 17:54:31 +13:00
README.md update README 2025-04-02 17:01:44 +13:00
screenshot-1.png update README 2025-03-22 16:21:08 +13:00

Digraph Picker

A Neovim plugin for browsing and inserting digraphs. The plugin can be configured with custom digraphs.

Screenshot

Installation

  • Download and install from the Github srackham/digraph-picker.nvim repo using your preferred Neovim plugin installer.

  • Create a keyboard mapping to invoke the digraph picker e.g.

      vim.keymap.set({ 'i', 'n' }, '<C-k><C-k>', require('digraph-picker').insert_digraph,
        { noremap = true, silent = true, desc = "Digraph picker" })
    

LazyVim Configuration

If you use the LazyVim package manager:

  1. Create a Lua file (e.g. digraph-picker.lua) in the plugins configuration directory (normally ~/.config/nvim/lua/plugins/ on Linux) and add the following code:
    return {
      'srackham/digraph-picker.nvim',
      dependencies = {
        'nvim-telescope/telescope.nvim',
      },
      version = '*', -- Install latest tagged version
      config = function()
        local picker = require('digraph-picker')
        picker.setup()
        vim.keymap.set({ 'i', 'n' }, '<C-k><C-k>', picker.insert_digraph,
          { noremap = true, silent = true, desc = "Digraph picker" })
      end,
    }
    
  2. Restart Neovim. LazyVim will detect the new plugin file and install it from Github.

Digraph customisation

New digraphs can be added and builtin digraphs can be customised using the setup function digraphs option. The following example adds Umbrella and Flag digraphs and modifies the builtin Pilcrow digraph:

local picker = require('digraph-picker')
picker.setup({
  digraphs = {
    { digraph = 'um', symbol = '☂', name = 'Umbrella' },
    { digraph = 'fl', symbol = '⚑', name = 'Flag' },
    { digraph = 'pp', symbol = '¶', name = 'Pilcrow (paragraph sign)' },
  },
})

The rules for merging digraph definitions into the builtin digraph table are:

  • If the builtin digraph table contains a definition with the same symbol then non-nil digraph and name fields are updated in the builtin definition.
  • If the builtin table does not contain a definition matching symbol then the new definition is added to the builtin table.

Custom digraphs added with the setup function are also added to the Neovim internal digraph table and can be entered with the native Vim CTRL-K {char1} {char2} command.

The builtin digraphs table can be completely excluded by setting the exclude_builtin_digraphs setup option to true.

Usage

  • Press <C-k><C-k> (or whatever mapping you created) then search for and select a digraph from the picker.
  • The recommended <C-k><C-k> digraph picker key mapping plays nicely with the native Vim CTRL-K {char1} {char2} digraph command.
  • The convention of normal character case for the names of custom digraphs makes it easy to distinguish them from Vim's built in digraphs.

Implementation

  • The builtin digraph definitions were copied from the Vim digraph.txt help file (see the :h digraph.txt command).

Todo

  • Document the API.
  • Add Vim help command documentation.