Let's say I want to edit the text
blahblah WombatModeFunctor
to be
blahblah WombatModeFunctor::WombatModeFunctor
The way I know to do it is:
- Move the caret (cursor) until it is over the W
- Use
yw
to yank the word - Move the caret 1 position to the left of the W
Use
p
to paste the yanked word. Now you have:blahblah WombatModeFunctorWombatModeFunctor
but the caret is over the first 'r', so you have to
- Move the caret 1 position to the right of the r
- Enter INSERT mode
- Type
::
My questions are:
- Why is step 3 necessary? It seems silly that a
p
right after ayw
would cause a pasting after the first letter of the word you just yanked. - Why is step 5 necessary? It seems more intuitive that the caret would be after the final pasted character, not on top of it
- Is there a more efficient vim incantation for this action?