1

The dot command in Vim repeats the "last change", but I am not exactly sure what constitutes the "last change". For example, if I type the sequence:

A;{ESC}j.

Then a semi-colon is appended to the current line, but I have to type "j" again.

In other words, the dot macro only does "A;{ESC}", so apparently the ESC is defining the end of the "last change". Why doesn't it include the "j" as well?

1
  • 5
    Change here many any command that changes the buffer's contents. Think of it as an edit. "j" doesn't change the contents. The "A" command finishes as soon as you press ESC. vimdoc.sourceforge.net/htmldoc/change.html
    – Mikel
    Commented Jul 7, 2014 at 20:46

1 Answer 1

4

A change is any command that modifies the text in the current buffer. You'll find all commands listed under :help change.txt. In insert mode, a change is further limited to a sequence of continually entered characters, i.e. if you use the cursor keys to navigate (which you shouldn't), only the last typed part is repeated.

Commands like j are motions; i.e. they don't affect the text, and just move the cursor. Those are not repeated. If you want to repeat multiple changes, or a combination of movements and changes, record the steps into a macro (e.g. qaA;<Esc>jq), and then repeat that (@a).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .