Hello everyone.
I am trying to highlight individual characters within a match. As an example: for every instance of the word animal
in my document, I want to highlight the characters a, n and l within it. Ideally this highlighting is also easily toggle-able.
Anyone got an idea how this could be implemented easily and efficiently? I already found the functions addmatch
and addmatchpos
, but these allow me only to highlight the entire word (as far as I can see).
Some background: inspired by chording keyboards, I want to write a small plugin that allows to write entire words by simultaneously pressing a certain combination of keys (zb. pressing A, N and L in insert mode writes ‘animal’), using the arpeggio-package. Under the hood there is a dictionary that maps these shortcuts to their expanded words. I already got that working.
Now I want the thing itself to teach me all the possible chords by highlighting the chording letters in a word that can be chorded, so that when I type a word, I can see how it could have been chorded.
Any help is welcome.