Traffic simulations can help to explore novel and efficient transportation solutions that overcome traffic problems such as traffic jams and road planning. Traditional traffic simulators usually leverage a car-following model to simulate the vehicle's behavior in the real-world traffic environment. However, these calibrated simplified physical models often fail to accurately predict the pattern of vehicle's movement in complicated real-world traffic environment. Considering the complexity and non-linearity of the real-world traffic, this paper unprecedentedly treat the problem of traffic simulation as a learning problem, and proposes learning to simulate (L2S) vehicle trajectory. We use the generative adversarial imitation learning framework to estimate the policy that provides sequential decisions for the vehicle given real-world demonstrations. The experiment on real-world traffic data shows the superior performance in simulating vehicle trajectories of our method compared to traditional traffic simulation approaches.