  We show global asymptotic stability of solitary waves of the nonlinear
Schr\"odinger equation in space dimension 1. Furthermore, the radiation is
shown to exhibit long range scattering if the nonlinearity is cubic at the
origin, or standard scattering if it is higher order. We handle a general
nonlinearity without any vanishing condition, requiring that the linearized
operator around the solitary wave has neither nonzero eigenvalues, nor
threshold resonances. Initial data are chosen in a neighborhood of the solitary
waves in the natural space $H^1 \cap L^{2,1}$ (where the latter is the weighted
$L^2$ space). The proof relies on the analysis of resonances as seen through
the distorted Fourier transform, combined for the first time with modulation
and renormalization techniques.
