The inelastic interaction between flying particles and optical nanocavities gives rise to entangled states in which some excitations of the latter are paired with momentum changes in the former. Specifically, free-electron entanglement with nanocavity modes opens appealing opportunities associated with the strong interaction capabilities of the electrons. However, the achievable degree of entanglement is currently limited by the lack of control over the resulting state mixtures. Here, we propose a scheme to generate pure entanglement between designated optical-cavity excitations and separable free-electron states. We shape the electron wave function profile to select the accessible cavity modes and simultaneously associate them with targeted electron scattering directions. This concept is exemplified through theoretical calculations of free-electron entanglement with degenerate and nondegenerate plasmon modes in silver nanoparticles and atomic vibrations in an inorganic molecule. The generated entanglement can be further propagated through its electron component to extend quantum interactions beyond existing protocols.