Combining vectors, accents and subscripts produces bad result
I'd simply back up a little the arrow:
\documentclass{article}
\usepackage{mathtools}
\DeclareRobustCommand{\zvec}[1]{%
\mathrlap{\vec{\mkern-2mu\phantom{#1}}}#1%
}
\begin{document}
\begin{gather*}
\zvec{r} + \zvec{r}' \\
\zvec{r}_\textnormal{g} + \zvec{r}_\textnormal{g}' + \zvec{r}_\textnormal{g}''
\end{gather*}
\end{document}