  We study three-dimensional $\mathcal{N}=2$ supersymmetric Chern-Simons-matter
gauge theories with a one-form symmetry in the $A$-model formalism on
$\Sigma_g\times S^1$. We explicitly compute expectation values of topological
line operators that implement the one-form symmetry. This allows us to compute
the topologically twisted index on the closed Riemann surface $\Sigma_g$ for
any real compact gauge group $G$. All computations are carried out in the
effective $A$-model on $\Sigma_g$, whose ground states are the so-called Bethe
vacua. We discuss how the 3d one-form symmetry acts on the Bethe vacua, and how
its 't Hooft anomaly constrains the vacuum structure. In the special case of
the $SU(N)_K$ $\mathcal{N}=2$ Chern-Simons theory, we obtain results for the
$(SU(N)/\mathbb{Z}_r)^{\theta}_K$ $\mathcal{N}=2$ Chern-Simons theories, for
all non-anomalous $\mathbb{Z}_r \subseteq \mathbb{Z}_N$ subgroups of the center
of the gauge group, and with the associated $\mathbb{Z}_r$ $\theta$-angle
turned on, reproducing and extending various results in the literature. In
particular, we find an interesting mixed 't Hooft anomaly between gravity and
the $\mathbb{Z}_r$ one-form symmetry of the $SU(N)_K$ theory (for $N$ even,
$\frac{N}{r}$ odd and $\frac{K}{r}$ even). This plays a key role in our
derivation of the Witten index, which we explicitly compute for any $N$, $K$
and $r$ in terms of refinements of Jordan's totient function. Our results lead
to precise conjectures about integrality of indices, which appear to have a
strong number-theoretic flavour. Note: this paper directly builds upon
unpublished notes by Brian Willett from 2020.
