  Here we report new ${\it ab initio}$ calculations of the effective
recombination coefficients for the \ion{N}{ii} recombination spectrum. We have
taken into account the density dependence of the coefficients arising from the
relative populations of the fine-structure levels of the ground state of the
recombining ion, an elaboration that has not been attempted before for this
ion, and it opens up the possibility of electron density determination via
recombination line analysis. Photoionization cross-sections, bound state
energies, and the oscillator strengths of \ion{N}{ii} with $n \leq 11$ and $l
\leq 4$ have been obtained using the close-coupling R-matrix method in the
intermediate coupling scheme. Photoionization data were computed that
accurately map out the near-threshold resonances and were used to derive
recombination coefficients, including radiative and dielectronic recombination.
Also new is including the effects of dielectronic recombination via high-$n$
resonances lying between the $^2$P$^{\rm o}$\,$_{1/2}$ and $^2$P$^{\rm
o}$\,$_{3/2}$ levels. The new calculations are valid for temperatures down to
an unprecedentedly low level (approximately 100 K). The newly calculated
effective recombination coefficients allow us to construct plasma diagnostics
based on the measured strengths of the \ion{N}{ii} optical recombination lines
(ORLs).
  The derived effective recombination coefficients are fitted with analytic
formulae as a function of electron temperature for different electron
densities. The dependence of the emissivities of the strongest transitions of
\ion{N}{ii} on electron density and temperature is illustrated. Potential
applications of the current data to electron density and temperature
diagnostics for photoionized gaseous nebulae are discussed. We also present a
method of determining electron temperature and density simultaneously.
