Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

undo

vim

redo

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

like image 696
flybywire Avatar asked Oct 12 '09 17:10

flybywire


People also ask

How do I undo a redo in Vim?

To undo a change in Vim/Vi type u , and to redo a change which was undone use the Ctrl-R key sequence. Vim also supports undo branches . Feel free to leave a comment if you have any questions.

What does Ctrl Z do in Vim?

Hit ctrl-z, and fire up vim with the new stuff you want. When you're done, quit the current vim session and come back to your old context with `fg`. The key observation is this stacks inductively, so you cant tumble down the dependency rabbit hole and always come back to the context you were at originally.

What is undo Redo command?

To undo an action, press Ctrl + Z. To redo an undone action, press Ctrl + Y. The Undo and Redo features let you remove or repeat single or multiple typing actions, but all actions must be undone or redone in the order you did or undid them – you can't skip actions.

How do I undelete in Vi?

Undo changes in vim / ViType u to undo the last change. To undo the two last changes, you would type 2u . Press Ctrl-r to redo changes which were undone. In other words, undo the undos.


2 Answers

Ctrl+r

like image 64
John Millikin Avatar answered Sep 20 '22 18:09

John Millikin


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

like image 45
Peter Avatar answered Sep 23 '22 18:09

Peter