9

The . command is super useful for quickly doing the last primitive action again. However, any other modification I do in between will override this.

Is there a way to recall&repeat older changes without having to define them as a macro, similar to how the "2 buffer always contains the pænultimate yank?

  • 3
    No, it's impossible. – romainl Jun 16 '16 at 14:01
  • 1
    Upvote for archaic spelling of obtuse word. – user151841 Jun 16 '16 at 20:01
  • 1
    @user151841: digraphs FTW! – leftaroundabout Jun 16 '16 at 20:47
6

No, this is not possible. After some searching on the web, it appears other people have asked about this very feature before on other stack exchange sites:

And even on the vim mailing group:

Both of these say it is impossible. However, Bram Moolenaar (the author and maintainer of vim) is on that email thread, and while he didn't say that feature was possible, he did hint at the possibility of implementing it sometime eventually.

How about Vim keeping a list of the last N typed keys? Suppose there is a function keyhistory(1), where the argument is how far back you look.

I wonder how that would be used in a plugin.

I don't know how high on his priority list this is (probably not very high), but I suppose you could sponsor vim and vote for this feature if you really want it.

| improve this answer | |
  • 2
    Yeah, it shall become possible, once Vim gets rid of global variables, and all edit functions become re-entrant. Don't hold your breath. It might happen before universal peace and the end of hunger, but I wouldn't really expect it much sooner. – Sato Katsura Jun 16 '16 at 18:09

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.