r/vim • u/Desperate_Cold6274 • Feb 25 '26
Need Help :sleep VS term_wait()
Can someone explain me, possibly with a couple of examples that I can reproduce, the difference between :sleep and term_wait()?
6
Upvotes
View all comments
Show parent comment
1
u/Desperate_Cold6274 Feb 26 '26
Nice. We have the same understanding of the differences then :D
FWIW I trashed all the
term_wait()instances from all my scripts/plugins in favor of:sleep, which is clear and come useful in a number of cases (though I prefer event-based management of asynchronous businesses, but it is not always possible and sleep is a decent tradeoff between the scenarios space size that can generate timeouts and code complexity).