How do I do redo (i.e. "undo undo") in Vim?
In Vim, I did too much undo. How do I undo this (that is, redo)?
按Ctrl + R
Also check out :undolist
, which offers multiple paths through the undo history. This is useful if you accidentally type something after undoing too much.
Strange nobody mentioned :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<CR>
<=> Ng+
and :later Nf
for file writes.
上一篇: 使用vim命令/按键?