I am writing a very small script in VimL and I am looking to simulate the actual typing of a given string.
The problem I am facing is that everything I try to put the whole chain immediately into the buffer, so the whole operation looks completely atomic and does not display the natural latency of char -by-char input.
I tried several options for the function below, and although I added sleep 50min different places, I do not get the desired behavior:
function! FakeTyping(string)
let list = split(a:string)
for word in list
for letter in split(word)
execute "normal a" . letter . "\<esc>"
endfor
endfor
endfunction
Is it possible? and if so, what am I missing?
source
share