如何在Vim中重做(即“撤消撤销”)?

[英]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)?

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

9 个解决方案

#1


716  

Ctrl+r

Ctrl + r

#2


114  

Also check out :undolist, which offers multiple paths through the undo history. This is useful if you accidentally type something after undoing too much.

也可以检查:undolist,它提供了通过撤销历史的多条路径。这是很有用的,如果你无意中键入了一些东西,而不是做了太多。

#3


43  

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.

(假设您第一次编辑该文件是在9999999天之前),或者,如果您还记得当前撤消状态和需要的状态之间的差异,则分别使用Nh、Nm或Ns,分别为小时、分钟和秒。+:后来的N <=> <=> Ng+和:稍后的Nf文件写入。

#4


35  

Vim documentation

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}

#5


17  

In command mode, use the U key to undo and Ctrl + r to redo. Have a look at http://www.vim.org/htmldoc/undo.html.

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

#6


9  

Refer to the "undo" and "redo" part of vim document.

请参考vim文档中的“撤消”和“重做”部分。

:red[o] (Redo one change which was undone) and {count} Ctrl+r (Redo {count} changes which were undone) are both ok.

:红色[o](重做一个未完成的更改)和{count} Ctrl+r (Redo {count}更改已撤消)都可以。

Also the :earlier {count} (Go to older text state {count} times.) could always be a substitute for undo and redo.

另外,更早的{count} (Go to old text state {count} times.)可能永远是撤销和重做的替代。

#7


6  

First Press ESC key to exit from edit mode.

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

Then,

然后,

For Undo use u key as many times you want to undo.

对于撤消使用u键,您需要多次撤销。

For Redo use CTRL +r key

重新使用CTRL +r键。

#8


3  

CTRL+r

CTRL + r

The "r" is lower-case.

小写字母“r”。

#9


0  

Using VsVim for Visual Studio?

使用VsVim进行Visual Studio?

I came across this when experimenting with VsVim, which provides bindings for vim-commands in Visual Studio.

我在尝试VsVim时遇到了这个问题,VsVim为Visual Studio中的vim命令提供绑定。

I know about ctrlr in vim itself, but this particular binding does not work in VsVim (at least not in my setup?).

我知道在vim中是关于ctrl - r的,但是这个绑定在VsVim中不起作用(至少在我的设置中没有)。

What does work however, is the command :red. This is a little bit more of a hassle than the above, but still fine when you really need it.

然而,真正起作用的是命令:红色。这比上面提到的要麻烦的多,但是当你真的需要它的时候仍然可以。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2009/10/12/94dae757dcd62bcb3f75629b43b86adf.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com