Sometimes I make a change, then in my scramble to move to somewhere else that I want to repeat the change, I accidentally make some edit (e.g. ill).

I would normally undo the accidental edit with u, but now I can't use . anymore to repeat my last meaningful change, my intended change.

Is there a way I can preserve the last meaningful change I made? Either, have u revert the last command stored in ., or save myself from accidental edits differently.

I know that 100% of the time I use u, unless my last command was ., then the command I undo with u should also not be repeated by ..

I already know I can use macros to repeat changes, so I am looking for solutions that will work for commands I executed without recording them into macros.

  • There's no built in/accessible storage of Normal mode command history. No easy path by custom script either. Different question but touching on some related ground: vi.stackexchange.com/questions/15713/…
    – B Layer
    Sep 4, 2019 at 1:03
  • If someone were to, say, write a plugin for this it might involve setting up persistent storage of-w/-W output. There might be an answer here that talks about that....I seem to recall. But that's going to be a non-trivial amount of work.
    – B Layer
    Sep 4, 2019 at 1:14


Your Answer

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

Browse other questions tagged or ask your own question.