How do I do redo (i.e. “undo undo”) in Vim?

后端 未结 10 730
花落未央
花落未央 2021-01-29 16:53

In Vim, I did too much undo. How do I undo this (that is, redo)?

10条回答
  •  天命终不由人
    2021-01-29 17:45

    Use :earlier/:later. To redo everything you just need to do

    later 9999999d
    

    (assuming that you first edited the file at most 9999999 days ago), or, if you remember the difference between current undo state and needed one, use Nh, Nm or Ns for hours, minutes and seconds respectively. + :later N <=> Ng+ and :later Nf for file writes.

提交回复
热议问题