could be a few things

air pocket in the coolant (which seems to be the case as you said when it warms up it idles normal)
bad IACV
under the throttle body to you have the ICV? which has white top and coolant lines going thru it? If so you can try adjusting that
Also have you adjusted the throttle body? I don't mean at the cables either

Is your radiator low of coolant???

Is your temp gauge working inside of the car ?