I have this function that I rarely run and it uses
matchaddpos. This function highlights at a set position so if I edit text, the same spot is highlighted even though the contents have shifted. I figure the best way to solve this is to create an autocmd like this:
augroup headwords autocmd! autocmd InsertEnter * call clearmatches() augroup end
That works fine, but it seems unnecessary to have that run every time I enter insert mode. How could I make this "self destructing". Where if this autocmd runs one, it no longer runs on future InsertEnter's?