I have written a vimscript function. I want to use autocmd
to call this function when a character is deleted with the x
key. But autocmd requires an event name. Which event is triggered when a character is deleted with the x
key?
-
1Welcome to Vi and Vim! – D. Ben Knoble♦ Feb 8 '20 at 19:47
-
@D.BenKnoble Thank you! – aks Feb 8 '20 at 19:58
There is no such event.
There is TextChanged event that is generally called when text was changed in normal mode (including x
I guess). I am not sure this what you need though...
Why not remap x
key to delete a character and call your function?
func! MyFunc()
echo printf("You have just deleted '%s'", getreg(v:register))
endfunc
noremap x x:call MyFunc()<CR>