How to typeset a primed vector

Priming a vector denoted with the arrow is, as you discovered, not a really good thing to do. You want to prime the letter, not the whole construction.

\documentclass{article}
\newcommand{\pvec}[1]{\vec{#1}\mkern2mu\vphantom{#1}}

\begin{document}
$\vec{p}+\pvec{p}'=\pvec{p}''$
\end{document}

enter image description here


Adding a small amount of space in the first option should make it better:

{\vec{p}\,}'

There's a problem I don't get to understand. And it's the fact that if there are multiple atoms inside a \vec it gets recolocated. I comment a little bit here.

Disclaimer: this is not fully correct (because, for instance, the prime gets recolocated), but the fact that sometimes \vec{{}<something>} looks better than \vec{<something>} annoys me.

A possible solution is:

\let\originalvec\vec 
\renewcommand*\vec[1]{\originalvec{\kern0pt #1}}

If that's not enough, you can mix it with egreg's answer

 \newcommand*\pvec[1]{\vec{#1}\mkern1mu\vphantom{#1}}

Full compilable example

\documentclass{scrartcl}

\let\originalvec\vec
\renewcommand\vec[1]{\originalvec{\kern0pt #1}}
\newcommand*\pvec[1]{\vec{#1}\mkern2mu\vphantom{#1}}

\begin{document}
$\vec p + \pvec p' = \pvec p''$

$\vec h = \vec r \times \vec v = \vec r \times \pvec r'$
\end{document}

enter image description here