  We conduct a pseudo-$C_\ell$ analysis of the tomographic cross-correlation
between 1000 deg$^2$ of weak lensing data from the Kilo-Degree Survey
(KiDS-1000) and the thermal Sunyaev-Zeldovich (tSZ) effect measured by Planck
and the Atacama Cosmology Telescope (ACT). Using HMx, a halo-model-based
approach that consistently models the gas, star, and dark matter components, we
are able to derive constraints on both cosmology and baryon feedback for the
first time from these data, marginalising over redshift uncertainties,
intrinsic alignment of galaxies, and contamination by the cosmic infrared
background (CIB). We find our results to be insensitive to the CIB, while
intrinsic alignment provides a small but significant contribution to the
lensing--tSZ cross-correlation. The cosmological constraints are consistent
with those of other low-redshift probes and prefer strong baryon feedback. The
inferred amplitude of the lensing--tSZ cross-correlation signal, which scales
as $\sigma_8(\Omega_\mathrm{m}/0.3)^{0.2}$, is low by $\sim 2\,\sigma$ compared
to the primary cosmic microwave background constraints by Planck. The
lensing--tSZ measurements are then combined with pseudo-$C_\ell$ measurements
of KiDS-1000 cosmic shear into a novel joint analysis, accounting for the full
cross-covariance between the probes, providing tight cosmological constraints
by breaking parameter degeneracies inherent to both probes. The joint analysis
gives an improvement of 40% on the constraint of
$S_8=\sigma_8\sqrt{\Omega_\mathrm{m}/0.3}$ over cosmic shear alone, while
providing constraints on baryon feedback consistent with hydrodynamical
simulations, demonstrating the potential of such joint analyses with baryonic
tracers such as the tSZ effect. We discuss remaining modelling challenges that
need to be addressed if these baryonic probes are to be included in future
precision-cosmology analyses.
