I've been coughing up phlegm all night and finally coughed up vomit and black phlegm twice? I still can't stop coughing I have been a smoker for 5 year

Possibilities..., You may have acute bronchitis from either a viral or bacterial infection. You may also have bronchospasm contributing to this cough. See your doctor for diagnosis and treatment. You really need to quit smoking asap to decrease your airway inflammation. If this cough has been present for more than 3 weeks, chronic bronchitis needs to be ruled out as well. Treatment for all these is available.