Austin is on the right track, but only with the wrong event. Take a look at the CursorMovedIevent autocmd. Basically, it fires at any time when the keyboard cursor moves in Insert mode. Enter a character? The cursor moves and the event fires.
Remember that this is a little hard for your use, because the cursor can move due to things other than entering or deleting characters. The user can use the arrow keys to move back where they want to edit. You will pop up completion with each step.
I can not find anything in the help about local auto-commands with a window, but there is a buffer-locale, so it can be quite close.
source
share