  The second data release from the Gaia mission (Gaia DR2) includes, among its
billion entries, as- trometric parameters for binary companions to a number of
known pulsars, including white dwarf companions to millisecond pulsars and the
non-degenerate components of so-called "black widow" and "redback" systems. We
find 22 such counterparts in DR2, of which 12 have statistically sig- nificant
measurements of parallax. These DR2 optical proper motions and parallaxes
provide new measurements of the distances and transverse velocities of the
associated pulsars. For the most part, the results agree with existing radio
interferometric and pulsar timing-based astrometry, as well as other distance
estimates based on photometry or associations, and for some pulsars they
provide the best known distance and velocity estimates. In particular, two of
these pulsars have no previous dis- tance measurement: PSR J1227$-$4853, for
which Gaia measures a parallax of $0.62\pm 0.16$ mas, and PSR J1431$-$4715,
with a Gaia parallax of $0.64\pm 0.16$ mas. Using the Gaia distance
measurements, we find that dispersion measure-based distance estimates
calculated using the NE2001 and YMW16 Galactic electron density models are on
average slightly underestimated, which may be a selection effect due to the
over-representation of pulsars at high Galactic latitudes in the present Gaia
sample. While the Gaia DR2 results do not quite match the precision that can be
achieved by dedicated pulsar timing or radio interferometry, taken together
they constitute a small but important improvement to the pulsar distance scale,
and the subset of millisecond pulsars with distances measured by Gaia may help
improve the sensitivity of pulsar timing arrays to nanohertz gravitational
waves.
