Witness David Johnston said the incident was the most horrendous thing he'd seen.
An eyewitness to the incident, which took place in the early hours of
Saturday, claims the driver deliberately drove into the victim after he spat on the taxi.
The victim required hospital treatment for swelling and cuts to the head after being hit by a black hackney-style cab on Restalrig Road South, near Leith Links.
David Johnston, 42, a bartender at a pub on the Shore who called paramedics to the scene, was walking home from work at around 1.20am and claimed the black cab driver accelerated to around 35mph before lining the car up and crashing into the man.
He said: "The driver sped up and aimed right for him before ploughing into him.
"He was sent flying about six foot before falling on to the ground.
"I ran over and the guy was lying gurgling in a pool of blood.
"He looked like he was in a pretty bad way but the ambulance arrived quickly."
Mr Johnston, said the victim, who he estimated to be in his 40s, tried to flag down the taxi and spat on it when the driver failed to stop.
"I think he was trying to get a taxi and it's not stopped for him. As it passed he's turned and spat on it.
"The driver has pulled a sharp U-turn and by this time the guy is still about a foot on to the road walking away. He wouldn't have seen what hit him.
"The taxi even mounted the pavement after he'd hit him.
"Obviously the guy shouldn't have spat on his cab but it's not like it was a glancing blow, the cabbie deliberately aimed for him and ran him over.
"He could be in no doubt that he had hit a pedestrian."
He added: "I just can't see how it would have been an accident. It's not like he'd given him a glancing blow. He's driven at him head-on."
Mr Johnston said he couldn't shake off the horror of the incident.
"I haven't slept all night thinking about this - it was one of the most horrendous things I have ever seen.
"There was a such a big bang people in their homes would have heard the thud. I called the ambulance and waited with the guy until the police and paramedics arrived.
"If I had not been there and that guy had been left laying there for a few hours he would have been dead."
Lothian and Borders CID are investigating the incident and have appealed for witnesses.
Officers have been checking CCTV footage in the area and speaking to black cab firms.
A police spokesperson said: "At about 1.20am on Saturday, a male with a head injury was discovered lying on the footpath in Restalrig Road. A passing member of the public rendered assistance prior to the arrival of the ambulance service. Eyewitnesses speak to a black hackney-style taxi striking the male as he walked on the footpath and failing to stop.
"We are working to establish exactly what happened in this incident where a man has been left badly injured and requiring hospital treatment.
"Although it happened in the early hours of the morning, we are keen to hear from anyone who may have seen something suspicious.
"Police are treating it as attempted murder.
"Anyone with information should contact on 0131-311 3131, or 0800-555 111."