在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}

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

在命令模式下,使用U键撤销,使用Ctrl + r重做。看看http://www.vim.org/htmldoc/undo.html。

实际上,:undolist很难使用,而Vim的:early和:later对更改的时间跟踪只能用于航向纹理修复。

鉴于此,我使用了一个插件,该插件将这些特性结合在一起,以提供一个可视的可浏览撤消操作树,称为“Gundo”。

显然,只有在需要细粒度修复,或者不确定希望返回的文档的确切状态时,才可以使用这种方法。看到:Gundo。图形化你的Vim撤销树的风格