6

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:

f"d$
j
.

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 – fruglemonkey Feb 17 '16 at 12:31
9

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-;|

IE:

f"d$
j
;.

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

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.