在Vim中,我做了太多撤销操作。我如何撤销这个(即,重做)?


当前回答

Vim文档

<Undo>      or                  *undo* *<Undo>* *u*
u           Undo [count] changes.  {Vi: only one level}

                            *:u* *:un* *:undo*
:u[ndo]         Undo one change.  {Vi: only one level}

                            *CTRL-R*
CTRL-R          Redo [count] changes which were undone.  {Vi: redraw screen}

                            *:red* *:redo* *redo*
:red[o]         Redo one change which was undone.  {Vi: no redo}

                            *U*
U           Undo all latest changes on one line.  {Vi: while not
            moved off of it}

其他回答

Vim文档

<Undo>      or                  *undo* *<Undo>* *u*
u           Undo [count] changes.  {Vi: only one level}

                            *:u* *:un* *:undo*
:u[ndo]         Undo one change.  {Vi: only one level}

                            *CTRL-R*
CTRL-R          Redo [count] changes which were undone.  {Vi: redraw screen}

                            *:red* *:redo* *redo*
:red[o]         Redo one change which was undone.  {Vi: no redo}

                            *U*
U           Undo all latest changes on one line.  {Vi: while not
            moved off of it}

首先按Esc键退出编辑模式。

然后,

对于撤销,使用你想撤销的任意次数的u键。

重做时,使用Ctrl +r键

CTRL + r

“r”是小写的。

还可以查看:undolist,它提供了通过撤消历史的多条路径。如果你在撤消太多操作后不小心输入了一些东西,这是很有用的。