You don't mention what you are feeding your cat, but the fact that he has gas and vomits shows that his digestion is disturbed. Until this situation clears up, feed him ground chicken, with psyllium husks and water, and slippery elm powder, in small amounts over the course of the day. Give also 2 capsules of a good probiotic over the course of the day, in the food. It sounds like the problem is a combination of hairballs along with an intestinal dysbiosis.