6

I'm appending text to "a" register with:"AyW.
If I wanted to repeat last change I would use:. But in this case I would like to repeat the last yank command.
Is there a command to repeat the last yank (append)? or should I use q to record a macro instead?

11

If you include the flag y in the cpoptions option;

set cpoptions+=y

then yanks may be repeated using .. See :help cpo-y:

                            *cpo-y*
    y   A yank command can be redone with ".".
  • 1
    Wow, I started writing up a really long hacky vimscript answer, but this is so much better. +1 – DJMcMayhem Jan 3 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.