  We present a theory of magnetic (S=1) Ni and nonmagnetic Zn impurities in
underdoped cuprates. Both types of impurities are shown to induce S=1/2 moments
on Cu sites in the proximity of the impurity, a process which is intimately
related to the spin gap phenomenon in cuprates. Below a characteristic Kondo
temperature, the Ni spin is partially screened by the Cu moments, resulting in
an effective impurity spin S=1/2. We further analyze the
Ruderman-Kittel-Kasiya-Yosida-type response of planar Cu spins to a
polarization of the effective impurity moments and derive expressions for the
corresponding ^{17}O NMR line broadening. The peculiar aspects of recent
experimental NMR data can be traced back to different spatial characteristics
of Ni and Zn moments as well as to an inherent temperature dependence of local
antiferromagnetic correlations.
