A violent ex-paratrooper who brutally attacked a man in Cumnock leaving him brain damaged has been jailed for more than five years.