Anything that looks like vomiting need not be vomiting.
Something coming out of mouth.. say curdish milk in infants is called possetting... a normal phenomena.
If its frothy or spitting out.. beware it may be type of seizure if child is losing eye contact along with.
The term vomiting from inside often means retching reflux or at times throat discomfort....
Vomiting just before cough and immediately with food is often choking or gagging than vomiting as seen th throat or tonsil issues.
Vomiting little time after food can be food pipe or gut problems primarily infections.
Vomiting with infection doesnt last more than three days.
Vomiting with hyperacidity or neurological issues tend to recur unless properly treated.
Repeated vomits can also be due to hut obstruction or TB.
Vomiting lasting for weeks surely has a serious problems. also available at kondekar.com