Assume the content:

foo fnord bar;" >> /tmp/foo/derp
gnarf foo fnord bar;" >> /tmp/foo/derp

I want to jump to the " and delete to end of line and repeat that over the rest of lines.

Yet when I:


it only deletes from my current cursor position to the end of file.

foo fnord bar;
gnarf foo fno

Yet I would have expected the line to read:

gnarf foo fnord bar;

How can I have vim repeat the jump movement as well on repeat?

  • 6
    Can't you just use a macro? qqf"d$j Feb 17, 2016 at 12:31

2 Answers 2


From the repeat documentation :

.           Repeat last change, with count replaced with [count].
            Also repeat a yank command, when the 'y' flag is
            included in 'cpoptions'.  Does not repeat a
            command-line command.

So, as expected, you're repeating the last change (d$).

If you want to repeat your movement, use ;:

;           Repeat latest f, t, F or T [count] times. See |cpo-;|



You could map a binding to perform ;. at the same time, if you want.


Like so:


This will substitute everything from the quote to the end of the line with nothing, hence deleting it.

Note that '%' will apply the operation to the whole file.

Use a range instead of % to change a specific sequence of lines:


to change lines 1 thru 17, or:


to change the current line and the following 3.

You should see the selections to be changed being highlighted as you type the regular expression, so you'll know if you got it right or not.

PS Yes, I know this is four years too late, but I'm doing this for my own education. The best way to learn is to teach :)

  • 1
    Welcome to Vi and Vim and thanks for contributing! You might want to preface your answer to indicate it doesn't answer the direct question (how to repeat last action with movement) but offers a different approach to solve the same problem. You might also want to discuss the advantages of this approach over the ;. approach from the accepted answer.
    – filbranden
    May 7, 2020 at 0:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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