/* Code-Comments */

Undo And Redo In Vim

September 17, 2019

Sometimes Vim is simultaneously impossible opaque and extraordinarily intuitive. That’s the case with the undo and redo.

To undo the last change, type u. To redo the last change, type ctrl+r.

These make plenty of sense as keybindings once you think about it - but until you’re told, it’s unlikely you’d come up with them on your own.1

There’s also a U keybinding which returns the last line modified to its original state (i.e. it reverses all the changes made). U, however, is not a true undo, but actually a change. That means it can be undone itself.

To access the vim manual enter a vim editor and while in the command mode, type :help undo.

Footnotes


Stephen Weiss

Thanks for reading! My name's Stephen Weiss. I live in Chicago with my wife, Kate, and dog, Finn.
Click here to see the archives of my weeks in review and sign up yourself!